Call to undefined function MySQL_connect()

Views: 38 Last modified: July 31st, 2011 Comments: 0

If you are using MySQL functions in PHP for the first time, you might experience the following error:

Fatal error: Call to undefined function mysql_connect() in

When this happens, it’s quite useful to check the php.ini file. Search for “extension=php_mysql.dll” (Windows extensions area), if you see a semicolon in front of it, remove it. If you don’t find this extension, you have to add it like this:

extension=php_mysql.dll

You tell apache you want to load this extension, which takes care of the MySQL functions.

If you already load this extension, it might be possible that the extension file does not exists. Here-for you have to check the extension directory of PHP. Go to your PHP directory and browse your way to the “ext” folder and search for the following file:

php_mysql.dll

Probably you don’t have this file here. In this case, go to the official PHP website and download a copy of PHP. Now copy and paste the missing extension. Restart your server and done!

VN:F [1.9.13_1145]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.13_1145]
Rating: 0 (from 0 votes)
    Bluehost

    Mail this!

    To: From:Sum {0+9} =  
    Anything to add ?

        You must be logged in to post a comment.