Hello Readers,
In order to create any web application using Codeigniter framework or any other PHP framework we need to configure database .
We have the database file inside application folder of a Codeigniter framework , inside application folder their is a config folder and inside config folder you will find database.php.
application->config->database.php
Database.php looks like this.
$db['default']['hostname'] = 'hostname';
$db['default']['username'] = 'username';
$db['default']['password'] = 'password';
$db['default']['database'] = 'database name';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = 'ps_';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = FALSE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
you can simply change the host , username , password and database name according to your need.
Enjoy coding.
0 Comment(s)