Page 1 of 1

new php5 installation doesn't work with MySQL

Posted: Tue Apr 13, 2004 5:47 am
by davidklonski
Hello

I have been working with MySQL under PHP 4.3.4 successfully.
I just upgraded to PHP 5.0 and for some reason I cannot interact with MySQL anymore.

Even the following simple code does nothing:

Code: Select all

<?php
$link = mysql_connect('localhost', 'root', '');
if (!$link) {
   die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
I can connect to MySQL without any problem using the shell commands. I have MySQL running as a service for Windows XP.

It seems like there is a configuration problem between PHP and MySQL.

Does anyone have any idea what could be wrong?

Posted: Tue Apr 13, 2004 5:49 am
by malcolmboston
from what i understand MySQL is no longer a "module for PHP" and you have to obtain it yourself

Posted: Tue Apr 13, 2004 5:52 am
by davidklonski
I am not sure what you mean by that (I am a newbie).

I did download and install MySQL 5.0 by myself.
I am just not sure how to configure PHP to work with the new MySQL installation.

thanks

Posted: Tue Apr 13, 2004 5:54 am
by malcolmboston
ive gotta go, so read this

http://www.sitepoint.com/forums/showthr ... did=142214

it explains it all

(php.ini on windows is located in the your system directory btw

so win2000 WINNT
windows xp WINDOWS