Codeigniter Database Error

Can someone help me?

I am new and trying to do CodeIgniter authentication, but when I try to make an error like this

Database error occurred

Error Number: 1046 

No database selected

 SELECT * FROM (`user`) WHERE `user_username` = 'amanda' AND user_passwordMD5("12345") = Filename: C:\xampp\htdocs\codeigniter\system\database\DB_driver.php Line Number: 330 

thanks

+6
source share
5 answers

Check the database.php file in the / config / application

 $db['default']['hostname'] = 'localhost'; $db['default']['username'] = 'root'; $db['default']['password'] = 'mypassword'; $db['default']['database'] = 'my_database'; // here is the database selection 
+1
source

please make sure you have configured the database configuration in application / config / database.php

 $db['default']['hostname'] = 'localhost'; $db['default']['username'] = 'root'; $db['default']['password'] = ''; $db['default']['database'] = 'my_database'; 
+3
source

Open the application/config/database.php file and change the following line:

 $db['default']['dbdriver'] = 'mysql'; 

To:

 $db['default']['dbdriver'] = 'mysqli'; 

This shift in mysqli saved per day.

0
source

Lost connection to MySQL server during query Row Number: 337

0
source

people who criticize here should have not only education, but also common sense. they should also know what time I made this comment and what my reputation rating was. It is not only about giving an answer, but also giving a proposal that a beginner can point out a problem. I could give an answer, but only after the publication of my comment did someone already give an answer. Look below - best among those represented here

 $config['hostname'] = "localhost"; $config['username'] = "username"; $config['password'] = "password"; $config['database'] = "database"; $config['dbdriver'] = "mysql"; $config['dbprefix'] = ""; $config['pconnect'] = FALSE; $config['db_debug'] = TRUE; $config['cache_on'] = FALSE; $config['cachedir'] = ""; $config['char_set'] = "utf8"; $config['dbcollat'] = "utf8_general_ci"; 
-1
source

All Articles