skip to Main Content

i have this project created by php and mysql but i have error

Filename: C:xampphtdocsdemosystemdatabaseDB_driver.php

Line Number: 124

and uploaded my project to solve this with very thanks for all team .

http://www.webchinupload.com/f/2019-05/ebae9eaf2a9655eb442da8a9e648da3e.rar

my error in line 124

$this->conn_id = ($this->pconnect == false) ? $this->db_connect() : $this->db_pconnect();

    // No connection resource?  Throw an error
    if ( ! $this->conn_id)
    {
        log_message('error', 'Unable to connect to the database');

        if ($this->db_debug)
        {
            $this->display_error('db_unable_to_connect');
        }
        return FALSE;
    }

2

Answers


  1. Change hostname to localhost

    $db['default']['hostname'] = 'localhost';
    $db['default']['username'] = 'root';
    $db['default']['password'] = ''; #database password
    $db['default']['database'] = 'e-frosh_test';
    
    Login or Signup to reply.
  2. Check your application/config/database.php

    In codeigniter framework

    $db['default'] = array(
        'dsn'   => '',
        'hostname' => 'localhost',
        'username' => 'root',
        'password' => 'root',//Put Your db passwaord
        'database' => 'e-frosh_test',
        '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
    );
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search