Welcome Guest, Not a member yet? Register   Sign In
Teach me how to program
#11

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."
Reply
#12

(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'); 
Reply
#13

I encounter this error :


An Error Was Encountered

Invalid DB driver

How to fix it?
" If I looks more intelligence please increase my reputation."
Reply
#14

(This post was last modified: 02-17-2016, 03:18 AM by ciadmin.)

(02-14-2016, 11:13 PM)davy_yg Wrote: I encounter this error :


An Error Was Encountered

Invalid DB driver

How to fix it?

READ THE *bleeping* MANUAL!
Reply
#15

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."
Reply
#16

Change dbdriver like this:
PHP Code:
$db['default'] = array(
...
'dbdriver' => 'mysqli',
...
); 
Reply
#17

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 passwordYES)

Filenamemysqli/mysqli_driver.php

Line Number
202

Backtrace
:

FileC:\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
.

FilenameC:/xampp/htdocs/ci3/application/core/MY_Controller.php

Line Number



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."
Reply
#18

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 passwordYES)
Filenamemysqli/mysqli_driver.php
Line Number
202
Backtrace
:
FileC:\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
.
FilenameC:/xampp/htdocs/ci3/application/core/MY_Controller.php
Line Number



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."
Reply
#19

(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 passwordYES)
Filenamemysqli/mysqli_driver.php
Line Number
202
Backtrace
:
FileC:\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
.
FilenameC:/xampp/htdocs/ci3/application/core/MY_Controller.php
Line Number



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
Reply
#20

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."
Reply




Theme © iAndrew 2016 - Forum software by © MyBB