Page 1 of 1

Fatal error: Call to undefined function mysql_connect()...

Posted: Wed Apr 22, 2009 7:46 am
by mdemirci01
Hello,

I'm new to PHP and MySQL. I've installed PHP 5.2.9-2, MySQL 5.1 on Windows Vista/IIS 7.0. I can run phpinfo() and use ionCube loader successfully.

php.ini is ok. extension_dir=C:\Program Files\PHP\ext and MySQL extension line is uncommented.

However, I cannot call function mysql_connect() it gives fatal error: Call to undefined function mysql_connect().

How can i solve the error. Thanks in advance.

Note: I don't know why but phpinfo() doesn't display any info about mysql.

Re: Fatal error: Call to undefined function mysql_connect()...

Posted: Thu Apr 23, 2009 10:24 am
by philln
Check to ensure that you have installed everything correctly and that the function actually exists!

Code: Select all

 
<?php
$function = 'mysql_connect';
if (function_exists($function)) {
echo $function.' exists';
} else {
echo $function.' cannot be found';
}
?>
 

Re: Fatal error: Call to undefined function mysql_connect()...

Posted: Thu May 14, 2009 12:57 am
by Osama111
I am also facing same error and using same version of PHP on Win2003.

I got this msg after testing with your code

mysql_connect cannot be found.

How to check the PHP.ini as there is no DLL section there in newer versions.

Re: Fatal error: Call to undefined function mysql_connect()...

Posted: Thu May 14, 2009 4:38 am
by Hightower
I could be wrong but you need to install a PHP extension so it can carry out MySQL functions. I'm not sure how to do this in Windows though as I use WAMP. I know you have to do this on *nix OS's.

Re: Fatal error: Call to undefined function mysql_connect()...

Posted: Thu May 14, 2009 4:41 am
by Hightower
EDIT: Sorry, just re-read your initial post - this info is useless as you have already tried it.