Codeigniter error: Call to undefined function mysql_pconnect()

Codeigniter error: Call to undefined function mysql_pconnect()

In this post we will show you Codeigniter error: Call to undefined function mysql_pconnect, hear for Codeigniter error: Call to undefined function mysql_pconnect we will give you demo and example for implement.

fOr remove Codeigniter error: Call to undefined function mysql_pconnect() or If you are using php 7 version the in Codeigniter will not run mysql you must need use pdo or mysqli

setp for CodeIgniter mysqli in your project

Step 1 : go to database.php and change dbdriver

/application/config/database.php

[php]
//change:
$db[‘default’][‘dbdriver’] = ‘mysql’;
//with:
$db[‘default’][‘dbdriver’] = ‘mysqli’;
[/php]

You should change the content of the file DB_driver.php in you codeigniter system directory.

Step 2 : go to DB_driver.php and change $dbdriver

Go to:
system/database/DB_driver.php
And change the following line:

[php]
var $dbdriver = ‘mysql’;
// to :
var $dbdriver = ‘mysqli’;
[/php]

here is a extraction of the DB_driver.php

[php]
* MySQLi Database Adapter Class – MySQLi only works with PHP 5
*
* Note: _DB is an extender class that the app controller
* creates dynamically based on whether the active record
* class is being used or not.
*
* @package CodeIgniter
* @subpackage Drivers
* @category Database
* @author ExpressionEngine Dev Team
* @link
*/
class CI_DB_mysqli_driver extends CI_DB {

var $dbdriver = ‘mysqli’;
[/php]

Hope this code and post will helped you for implement Codeigniter error: Call to undefined function mysql_pconnect. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve itsolutionstuck.

Leave a Comment