Welcome Guest, Not a member yet? Register   Sign In
Codeigniter database connection error
#1

I have a database error so guys can you all help me overcome this problem.

this is my database.php file

$active_group = 'default';
$query_builder = TRUE;

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

And I have inserted a image of my error also please look into it all give and answer.
And I'm using the codeigniter version 3.1.8
And I'm using the php version 7.2.5  

please guys help me find the problem.

Attached Files Thumbnail(s)
   
Reply
#2

@Heshan Make sure database 'electroshop' does exists in your database.
Reply
#3

Also make sure that you start the MySQL Server.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB