CodeIgniter Forums
error - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11)
+--- Thread: error (/showthread.php?tid=64363)

Pages: 1 2


error - davy_yg - 02-12-2016

Can anyone help me figure out

Fatal error: Uncaught Error: Call to undefined function mysql_pconnect() in C:\xampp\htdocs\gsa\system\database\drivers\mysql\mysql_driver.php:91 Stack trace: #0 C:\xampp\htdocs\gsa\system\database\DB_driver.php(115): CI_DB_mysql_driver->db_pconnect() #1 C:\xampp\htdocs\gsa\system\database\DB.php(148): CI_DB_driver->initialize() #2 C:\xampp\htdocs\gsa\system\core\Loader.php(346): DB(Array, NULL) #3 C:\xampp\htdocs\gsa\system\core\Loader.php(1171): CI_Loader->database() #4 C:\xampp\htdocs\gsa\system\core\Loader.php(152): CI_Loader->_ci_autoloader() #5 C:\xampp\htdocs\gsa\system\core\Controller.php(51): CI_Loader->initialize() #6 C:\xampp\htdocs\gsa\application\site\core\MY_Controller.php(7): CI_Controller->__construct() #7 C:\xampp\htdocs\gsa\application\site\controllers\home.php(9): MY_Controller->__construct() #8 C:\xampp\htdocs\gsa\system\core\CodeIgniter.php(308): Home->__construct() #9 C:\xampp\htdocs\gsa\index.php(202): require_once('C:\\xampp\\htdocs...') #10 {main} thrown in C:\xampp\htdocs\gsa\system\database\drivers\mysql\mysql_driver.php on line 91

What's wrong with this error?


RE: error - kenjis - 02-12-2016

It says Call to undefined function mysql_pconnect().

`mysql` functions are deprecated since PHP 5.5 and removed on PHP7.
You should not use them.

Please use `mysqli` functions or PDO.


RE: error - davy_yg - 02-12-2016

What does it depends on?

Does it depends on the Xampp version?

Because of I am using the newest xampp version therefore I have to use the newest php version. Is that correct?


RE: error - pdthinh - 02-13-2016

Do you use mysqli as dbdriver in your database config?


RE: error - davy_yg - 02-13-2016

If I am using a newer xampp version for php 7 do I have to upgrade my CI version?


RE: error - davy_yg - 02-13-2016

class CI_DB_mysql_driver extends CI_DB {

var $dbdriver = 'mysql';


I think I am using mysql instead of mysqli


RE: error - kenjis - 02-13-2016

(02-13-2016, 12:39 AM)davy_yg Wrote: If I am using a newer xampp version for php 7 do I have to upgrade my CI version?

You must use the latest CI, which is version 3.0.4.


RE: error - davy_yg - 02-13-2016

Here is the deal I am already have the old website build with that version of CI - if I am upgrading my xampp into the newest xampp version, do I have to upgrade my CI as well in order for it to work?


RE: error - kenjis - 02-13-2016

(02-13-2016, 12:48 AM)davy_yg Wrote: Here is the deal I am already have the old website build with that version of CI - if I am upgrading my xampp into the newest xampp version, do I have to upgrade my CI as well in order for it to work?

If you use PHP 7, you must use CI 3.0.

XAMPP has multiple versions. PHP 5.5/5.6/7.0.
See https://www.apachefriends.org/download.html


RE: error - davy_yg - 02-13-2016

How migrate CI 2 to CI 3?

Do I have to redownload the CI3? Is it enough just to change

line 91: return @mysql_pconnect($this->hostname, $this->username, $this->password);

or change to the mysqli_pconnect is enough?