PDA

View Full Version : Fatal error: Call to undefined function mysql_pconnect() in c:\.....\dbinfo.php


ssffcc
05-10-2006, 08:35 AM
my php pages was working yesturday, when i opened it again try to run it, it stoped working and show this message:

Fatal error: Call to undefined function mysql_pconnect() in c:\Inetpub\wwwroot\DreamWeaverSites\webadmin\dbinfo.php on line 10.

the code on dbinfo.php is:

<?php

// replace with your own MySQL details

define('MYSQL_HOST', 'localhost');
define('MYSQL_USER', 'root');
define('MYSQL_PASS', '');
define('MYSQL_DB', 'db_sss');

if (! mysql_pconnect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS) )
{
echo "Failed to connect to the server " . MYSQL_HOST;
exit;
}

mysql_select_db(MYSQL_DB);

?>

my index page has a line on top:

require('dbinfo.php');

please help

btw, I upgraded phy to the latest version of PHP 5.1.4 just now.
is this causing the problem? some articles say that is because i have PHP5+. but the version of PHP i had before was 5.1.2, which i had no problem with.
how come it happened with 5.1.4?

ssffcc
05-10-2006, 09:03 AM
well. now it is getting more blur, I uninstalled both 5.1.2 and 5.1.4, downloaded 4.4.2.2 and installed it, everything went back to normal.

the whole story is:
1) installed 5.1.2, worked fine
2) installed 5.1.4 without uninstalling 5.1.2, stopped talking with MySQL.
3) uninstall everything, reinstalled 5.1.2, still nothing works (as it should anyway)
4) uninstall everything, installed 4.4.2.2, the communication between php and mysql is back to normal.

can any one figure out why?
I am newbie to PHP and MySql, is there a clear instruction that i can follow to configure 5.1.4 so that php will talk to mysql no problem? I read the article on http://www.php.net/manual/en/ref.mysql.php, but having problem understand.

GJay
05-10-2006, 09:55 AM
PHP4 comes with the mysql functions included. PHP5 doesn't, so you'll need to add them.
Are you running with Windows or Linux?

marek_mar
05-10-2006, 01:08 PM
Let me suggest you to follow this guide (http://a51.phpweekly.net).

ssffcc
05-10-2006, 05:11 PM
thx all.

marek_mar, this guide you suggested includes installation of apache, which i dont need, will it be ok if i only install php and mysql by following this guide? i am so scared of having problem again

ssffcc
05-10-2006, 05:12 PM
Gjay, I am using winXP.

marek_mar
05-10-2006, 05:43 PM
Yes as long as you have apache. If you don't want to use a server at all you don't really need to "install" php at all.