-
davy_yg Senior Member
   
-
Posts: 307
Threads: 129
Joined: Nov 2014
Reputation:
-26
I add this:
config/autoload.php
PHP Code: $autoload['libraries'] = array('gsaconst_database');
Okay, I have this new error:
An Error Was Encountered
Unable to load the requested class: Gsaconst_database
I wonder why do I have to create a new class named " Gsaconst_database" ?
Since "Gsaconst_database" is the database name.
" If I looks more intelligence please increase my reputation."
-
freddy Member
  
-
Posts: 131
Threads: 17
Joined: Nov 2014
Reputation:
3
(02-14-2016, 08:40 PM)davy_yg Wrote: I add this:
config/autoload.php
PHP Code: $autoload['libraries'] = array('gsaconst_database');
Okay, I have this new error:
An Error Was Encountered
Unable to load the requested class: Gsaconst_database
I wonder why do I have to create a new class named " Gsaconst_database" ?
Since "Gsaconst_database" is the database name.
NO LIKE THAT !
JUST COPY AND PASTE THIS, DON'T PUT YOUR DATABASE NAME
PHP Code: $autoload['libraries'] = array('database');
-
davy_yg Senior Member
   
-
Posts: 307
Threads: 129
Joined: Nov 2014
Reputation:
-26
I encounter this error :
An Error Was Encountered
Invalid DB driver
How to fix it?
" If I looks more intelligence please increase my reputation."
-
davy_yg Senior Member
   
-
Posts: 307
Threads: 129
Joined: Nov 2014
Reputation:
-26
Hello,
I already cek the manual and still do not understand how to fix this problem.
config/database.php
PHP Code: $db['default'] = array( 'dsn' => '', 'hostname' => 'localhost', 'username' => 'gsaconst_admin', 'password' => '*****************', 'database' => 'gsaconst_database', 'dbdriver' => 'mysqli_connect', 'dbprefix' => 'pix_', 'pconnect' => TRUE, '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 );
http://www.codeigniter.com/user_guide/da..._DB_driver
class CI_DB_driver initialize()
Returns:
TRUE on success, FALSE on failure
Return type:
bool
Initialize database settings, establish a connection to the database.
---------------------------------------------------------------
ERROR MESSAGE:
http://localhost/ci3/
An Error Was Encountered
Invalid DB driver
" If I looks more intelligence please increase my reputation."
-
pdthinh Member
  
-
Posts: 106
Threads: 0
Joined: Jan 2015
Reputation:
8
Change dbdriver like this:
PHP Code: $db['default'] = array( ... 'dbdriver' => 'mysqli', ... );
-
davy_yg Senior Member
   
-
Posts: 307
Threads: 129
Joined: Nov 2014
Reputation:
-26
config/database.php
PHP Code: $db['default'] = array( 'dsn' => '', 'hostname' => 'localhost', 'username' => 'gsaconst_admin', 'password' => '************', 'database' => 'gsaconst_database', 'dbdriver' => 'mysqli',
http://localhost/ci3/
PHP Code: A PHP Error was encountered
Severity: Warning
Message: mysqli::real_connect(): (HY000/1045): Access denied for user 'gsaconst_admin'@'localhost' (using password: YES)
Filename: mysqli/mysqli_driver.php
Line Number: 202
Backtrace:
File: C:\xampp\htdocs\ci3\application\core\MY_Controller.php Line: 7 Function: __construct
File: C:\xampp\htdocs\ci3\application\controllers\home.php Line: 9 Function: __construct
File: C:\xampp\htdocs\ci3\index.php Line: 292 Function: require_once A Database Error Occurred
Unable to connect to your database server using the provided settings.
Filename: C:/xampp/htdocs/ci3/application/core/MY_Controller.php
Line Number: 7
database/DB_driver.php
PHP Code: abstract class CI_DB_driver {
/** * Data Source Name / Connect string * * @var string */ public $dsn;
/** * Username * * @var string */ public $username;
/** * Password * * @var string */ public $password;
/** * Hostname * * @var string */ public $hostname;
/** * Database name * * @var string */ public $database;
/** * Database driver * * @var string */ public $dbdriver = 'mysqli';
" If I looks more intelligence please increase my reputation."
-
davy_yg Senior Member
   
-
Posts: 307
Threads: 129
Joined: Nov 2014
Reputation:
-26
Hello,
There is another error appears in my localhost/ci3:
PHP Code: A PHP Error was encountered Severity: Warning Message: mysqli::real_connect(): (HY000/1045): Access denied for user 'gsaconst_admin'@'localhost' (using password: YES) Filename: mysqli/mysqli_driver.php Line Number: 202 Backtrace: File: C:\xampp\htdocs\ci3\application\core\MY_Controller.php Line: 7 Function: __construct File: C:\xampp\htdocs\ci3\application\controllers\home.php Line: 9 Function: __construct File: C:\xampp\htdocs\ci3\index.php Line: 292 Function: require_once A Database Error Occurred Unable to connect to your database server using the provided settings. Filename: C:/xampp/htdocs/ci3/application/core/MY_Controller.php Line Number: 7
username: gsaconst_admin
password: Yes
Database: gsaconst_database
This is the database settings:
config/database.php
PHP Code: $db['default'] = array( 'dsn' => '', 'hostname' => 'localhost', 'username' => 'gsaconst_admin', 'password' => ***********', 'database' => 'gsaconst_database', 'dbdriver' => 'mysqli', 'dbprefix' => 'pix_', 'pconnect' => TRUE, '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 );
Can anyone help me find out why this I cannot connect to the database ?
" If I looks more intelligence please increase my reputation."
-
Php Senior member
  
-
Posts: 56
Threads: 10
Joined: Feb 2015
Reputation:
-2
02-17-2016, 12:25 AM
(This post was last modified: 02-17-2016, 12:26 AM by Php.)
(02-17-2016, 12:00 AM)davy_yg Wrote: Hello,
There is another error appears in my localhost/ci3:
PHP Code: A PHP Error was encountered Severity: Warning Message: mysqli::real_connect(): (HY000/1045): Access denied for user 'gsaconst_admin'@'localhost' (using password: YES) Filename: mysqli/mysqli_driver.php Line Number: 202 Backtrace: File: C:\xampp\htdocs\ci3\application\core\MY_Controller.php Line: 7 Function: __construct File: C:\xampp\htdocs\ci3\application\controllers\home.php Line: 9 Function: __construct File: C:\xampp\htdocs\ci3\index.php Line: 292 Function: require_once A Database Error Occurred Unable to connect to your database server using the provided settings. Filename: C:/xampp/htdocs/ci3/application/core/MY_Controller.php Line Number: 7
username: gsaconst_admin
password: Yes
Database: gsaconst_database
This is the database settings:
config/database.php
PHP Code: $db['default'] = array( 'dsn' => '', 'hostname' => 'localhost', 'username' => 'gsaconst_admin', 'password' => ***********', 'database' => 'gsaconst_database', 'dbdriver' => 'mysqli', 'dbprefix' => 'pix_', 'pconnect' => TRUE, '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 );
Can anyone help me find out why this I cannot connect to the database ?
You missed single inverted comma from when password begin.
Web Developer
-
davy_yg Senior Member
   
-
Posts: 307
Threads: 129
Joined: Nov 2014
Reputation:
-26
I already cek the database.php , it actually has an ' in front of the password.
database.php
PHP Code: $db['default'] = array( 'dsn' => '', 'hostname' => 'localhost', 'username' => 'gsaconst_admin', 'password' => '********', 'database' => 'gsaconst_database', 'dbdriver' => 'mysqli', 'dbprefix' => 'pix_', 'pconnect' => TRUE, '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 );
I still unable to connect to the database.
" If I looks more intelligence please increase my reputation."
|