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

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
mdemirci01
Forum Newbie
Posts: 1
Joined: Wed Apr 22, 2009 7:36 am

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

Post 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.
philln
Forum Newbie
Posts: 12
Joined: Thu Apr 23, 2009 9:22 am

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

Post 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';
}
?>
 
Osama111
Forum Newbie
Posts: 1
Joined: Thu May 14, 2009 12:54 am

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

Post 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.
User avatar
Hightower
Forum Newbie
Posts: 22
Joined: Tue May 12, 2009 7:09 am
Location: Durham, UK

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

Post 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.
User avatar
Hightower
Forum Newbie
Posts: 22
Joined: Tue May 12, 2009 7:09 am
Location: Durham, UK

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

Post by Hightower »

EDIT: Sorry, just re-read your initial post - this info is useless as you have already tried it.
Post Reply