-5

Severity: 8192

Message: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead

Filename: mysql/mysql_driver.php

Line Number: 136

Backtrace:

File: C:\wamp\www\ci\application\controllers\c_testing.php Line: 27 Function: __construct

File: C:\wamp\www\ci\index.php Line: 315 Function: require_once

in my codeigniter file in databease.php i use this

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

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

then in my testing.php file

Class Testingdata extends CI_Model{
    function __construct(){
        parent::__construct();
        $this->load->database();
        $this->db->reconnect();
    }

    // data obtained from database 
    function get_data(){
        $this->db->select('*');
        $this->db->from('lecturer_profile');



        $query = $this->db->get();
        return $query->result();
    } 
}

?>`enter code here`
Shah
  • 17
  • 2

1 Answers1

0

You need to change the database config. Go to the following path in your project /application/config/database.php find the dbdriver setting and make sure it's mysqli.

Linesofcode
  • 5,327
  • 13
  • 62
  • 116