Php – How to Connect Database from Constant file in Codeigniter version 3.0

 

Here, Using this way you can connect with database from constant file.
then you can access the tables.

include(APPPATH.'config/database'.EXT);

$conn = mysql_connect($db['default']['hostname'], $db['default']['username'], $db['default']['password']);

mysql_select_db($db['default']['database'], $conn);