Setting Database Configuration in CodeIgniter?

Setting Database Configurations in Codeigniter very tiny task , just open database.php within applicationconfig. Set config like below , here database user “root”, password “”(no password), DB Name “db_name”.

if you want to disable persistent connnect just change $db['default']['pconnect'] = TRUE; to $db['default']['pconnect'] = FALSE;

if you want to Hide(disable) Database Error just change $db['default']['db_debug'] = TRUE; to $db['default']['db_debug'] = FALSE;

just like above changes to the configuration values you can change any of the DB config values(settings) any time to the config array.

Here the sample database.php script

I hope this tutorial helps you please don’t forget to give us your feedback in comments.

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.

0 0 vote
Article Rating
Notify of
Inline Feedbacks
View all comments Protection Status
Would love your thoughts, please comment.x