• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
error

#1
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?
Reply

#2
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.
Do you want to write tests for your apps? Our book, CodeIgniter Testing Guide would help you.
Reply

#3
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?
Reply

#4
Do you use mysqli as dbdriver in your database config?
Reply

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

#6
class CI_DB_mysql_driver extends CI_DB {

var $dbdriver = 'mysql';


I think I am using mysql instead of mysqli
Reply

#7
(02-13-2016, 01: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.
Do you want to write tests for your apps? Our book, CodeIgniter Testing Guide would help you.
Reply

#8
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?
Reply

#9
(02-13-2016, 01: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
Do you want to write tests for your apps? Our book, CodeIgniter Testing Guide would help you.
Reply

#10
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?
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.