Page 1 of 1

PHP and MySQL problem

Posted: Thu Nov 30, 2006 5:16 am
by aliweb
Hello

I am using MySQL 4.1 and PHP 5.1.1.
When I try to connect to MySQL in PHP using mysql_connect() method, it throws an error "Call to undefined function mysql_connect().

Then I uncommented the following line in C:\Windows\php.ini file

extension=php_mysql.dll

and placed php_mysql.dll in C:\Windows\System32

Now when I tried to run that PHP page again, it goes no where. I mean it neither throws an error nor loads the page. It just keeps on loading and the status bar below in Internet Explorer says "Waiting http://localhost/connection.php

Now after that even if I run a simple PHP page for e.g.

echo "Hello";

it doesn't work and keeps on loading.

If I comment that line again above, normal PHP page works but not connection ones.

I even placed libmysql.dll in C:\Windows\System32 but same problem.

My configuration is:

OS: Windows Server 2003
Web Server: IIS 6
PHP: 5.1.1
MySQL: 4.1
PHP Dir: C:\PHP

Please help

Posted: Thu Nov 30, 2006 8:46 am
by kaszu
MySQL library is not loaded
In php.ini, change from
display_startup_errors = Off
to
display_startup_errors = On
Then you will see the error.

I put "libmysql.dll" in Apache bin folder (i'm running php as apache module) and everything worked fine.
Make sure extension dir in php.ini is correct.

Posted: Thu Nov 30, 2006 2:55 pm
by RobertGonzalez
Restart your server. Then try again.