Category Archives: Codeigniter

Insert and List the data in codeigniter

Its a simple student entry form and listing of the entered students.You can follow the below steps to do this Step1: create a database named (studentdatabase) in the mysql using phpmyadmin. Below query u can execute through phpmyadmin

Step2: Configuration changes in different pages. In Application/config/routes.php $route[‘default_controller’] = “register”; default_controller will be a “welcome”… Read More »

Codeigniter default controller not working in PHP Version 5.6.15

Codeigniter controller will not work if we update your xampp version to v3.2.2. Or in other case if you upgrade the php version to 5.6+ in some cases, in the autoload.php in the config folder $autoload[‘libraries’] = array(‘form_validation’,’session’,’database’); if we remove database from the array codeigniter controller will work. So solution to work this controller… Read More »

Link not working in codeigniter, base_url() displaying “”http://::1” why?

If you create a link in codeigniter as like below

in some case above link will redirect to blank page and most of the case it will be look like as below

To Solve this issue please add below line in your config.php $config[‘base_url’] = ‘http://localhost/yourfoldername/’; if it is blank above issue will… Read More »

$this->session->set_flashdata not working in codeigniter?why? what is the solution for this.

while using set_flashdata() function, if it will throw below error as follows “In order to use the Session class you are required to set an encryption key in your config file” In this condition we have to set $config[‘encryption_key’] =” in the config.php file flash data will work fine if you set the encryption_key.

group_concat function not returning all values. one extra comma adding at the end of the data

solution is use the below code in your model $this->db->simple_query(‘SET SESSION group_concat_max_len=1000000’); refer the below link for more details http://mydoubts.in/blog/group_concat-function-not-returing-all-values-in-mysql-it-returns-some-values-with-one-comma-at-the-end/

Parse error:syntax error, unexpected end of file in C:\xampp\htdocs\…

This error coming into the codeigniter execution , becuase of some variable setting inside the php.ini file. Edit the php.ini file and update the short_open_tag=On. Bydefault php.ini settings for short_open_tag=Off

why this error:In order to use the Session class you are required to set an encryption key in your config file.

This error is showing becuase of encryptionkey missing in the config.php please add the below value for this $config[‘encryption_key’] = ‘safdafdsafdsafdsa323432432’; Answer: In order to use the Session class you are required to set an encryption key in your config file.

Why this error in codeigniter :A Database Error Occurred Unable to select the specified database:

A Database Error Occurred Unable to select the specified database: Filename: ..system\database\DB_driver.php An Error Was Encountered Answer: Ususally this error is showing becuase of configuration table.please check the database.php inside the config folder.edit the mysql credentials.