new php5 installation doesn't work with MySQL

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
davidklonski
Forum Contributor
Posts: 128
Joined: Mon Mar 22, 2004 4:55 pm

new php5 installation doesn't work with MySQL

Post 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?
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

from what i understand MySQL is no longer a "module for PHP" and you have to obtain it yourself
davidklonski
Forum Contributor
Posts: 128
Joined: Mon Mar 22, 2004 4:55 pm

Post 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
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post 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
Post Reply