Database Setting in Codeigniter
Database setting in codeigniter is the basic configuration after install the codeingiter in your server or localhost. Its very simple to setting database. This blog we will show you how to configure the data base in step by step.
1) Creat Database in your phpmyadmin
2) Open your projects folder -> application->config->database.php
3) Change you setting like below
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
$db['default'] = array( 'dsn' => '', 'hostname' => 'localhost', 'username' => 'root', 'password' => '', 'database' => 'test', // Here my database name is test. 'dbdriver' => 'mysqli', 'dbprefix' => '', 'pconnect' => FALSE, 'db_debug' => (ENVIRONMENT !== 'production'), 'cache_on' => FALSE, 'cachedir' => '', 'char_set' => 'utf8', 'dbcollat' => 'utf8_general_ci', 'swap_pre' => '', 'encrypt' => FALSE, 'compress' => FALSE, 'stricton' => FALSE, 'failover' => array(), 'save_queries' => TRUE ); |