Bladephp: Now with 8+ codeigniter, php, and laravel project 8+ php project From $37/Month From Rs. 2499/Month

How to database connect in Codeigniter

by
Category:codeigniter
codeigniter mysql
How to database connect in Codeigniter

Today we’re going to be learning how to connect and then query a database in CodeIgniter. Knowing how to manipulate and read databases is an essential tool for creating any dynamic web application. Let’s get started.

Code (application/config/database.php)

$db['default'] = array(
	'dsn'	=> '',
	'hostname' => 'localhost',
	'username' => 'root',
	'password' => '',
	'database' => 'hd_project3',
	'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
);

0 Comments


Html code work in comment box


Related Post