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

	
//change:
$db['default']['dbdriver'] = 'mysql';   
//with:
$db['default']['dbdriver'] = 'mysqli';

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:

	
var $dbdriver = 'mysql'; 
// to :
var $dbdriver = 'mysqli'; 

here is a extraction of the DB_driver.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'; 

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 onlincode. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs onlincode.org

Leave a Comment

Your email address will not be published. Required fields are marked *

  +  34  =  41

We're accepting well-written guest posts and this is a great opportunity to collaborate : Contact US