Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have updated my codeigniter version from 2.2.4 step by step to 3.0.6 and I get an error:

An uncaught Exception was encountered

Type: Error

Message: Call to undefined function mysql_pconnect()

Filename: path-to-projectsystemdatabasedriversmysqlmysql_driver.php

Line Number: 135

Backtrace:

File: path-to-projectapplicationcontrollersMain.php
Line: 10
Function: __construct

File: path-to-projectindex.php
Line: 315
Function: require_once

I have just replaced my index.php file and system directory with the new one and made some changes in my application according to tutorial.

and this is the Main controller:

class Main extends CI_Controller {

    function __construct()
    {
        parent::__construct();
        $this->load->model('main_model');
    }
}

What causes the problem?!

And this is the link of the tutorial.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
389 views
Welcome To Ask or Share your Answers For Others

1 Answer

Deprecated features in PHP 5.5.x:

The original MySQL extension is now deprecated, and will generate E_DEPRECATED errors when connecting to a database. Instead, use the MySQLi or PDO_MySQL extensions.

You're using the deprecated 'mysql' dbdriver. Locate the config/database.php file and change dbdriver to use 'mysqli' :

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...