470,594 Members | 1,560 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,594 developers. It's quick & easy.

Please help me connect PHP to MySql - Newbie problem


I'm a newbie at PHP and MySql, although I have wads of experience of
ASP, ASP.NET, SQL Server, etc.

I have just installed PHP 5.2.3 on a server (Windows Server 2003), as
well as MySql 5.0.45. Both of these work fine independently, but I can't
get PHP to connect to MySql.

The first (and probably most basic) problem is that when I run phpinfo()
I don't see any mention of MySql. I suspect that this is the cause of
the lack of connectivity.

I have removed the comments from the following two lines in php.ini
(which is in C:\Windows)...


I've also got the following line in there...

extension_dir = "C:\Program Files\PHP\ext\"

which points to the folder containing the two DLLs mentioned above.

I've rebooted the machine a couple of times since making these changes.

As I said, when I run phpinfo(), it doesn't mention MySql at all.

Anyone any ideas? If I try to connect, nothing happens. No errors,
nothing. I tried the following sample script from
http://uk.php.net/manual/en/function.mysql-connect.php to test it...

$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
die('Could not connect: ' . mysql_error());
echo 'Connected successfully';

(where I changed the user name and password obviously), but this didn't
produce anything. No message, no error, just a blank page.

TIA for any help

Alan Silver
(anything added below this line is nothing to do with me)
Jul 16 '08 #1
0 1014

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by duikboot | last post: by
2 posts views Thread by B Squared | last post: by
2 posts views Thread by Martin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.