albert Report post Posted April 18, 2012 Hello I want to run my php program that it reads its data from mysql but I have this error: Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\Code\PHP\Includes\DBConn.php on line 14 this error shows that this function is undefined however I set parameters correctly. what can I do? DBConn.php Share this post Link to post Share on other sites
Guest Sashibhusan Report post Posted April 20, 2012 Hi, You will get this error normally when your PHP does not recognize the mysql_connect() method, when running through Apache server. In this case please follow the below steps: 1. Please check once for your phpinfo(), whether the mySQL is listed inside there or not. 2. If not, then you need to configure the php.ini file.So search your server for libmysql.dll. Delete any instance of libmysql.dll that is not in the C:\PHP directory (your PHP installed directory). This limits the possibility of older MySQL client API's being used with PHP. 4. Search your server for php_mysql.dll. Delete any instance of php_mysql.dll that is not in the C:\PHP directory. This limits the possibility of older MySQL client API's being used with PHP. 5. Open your C:\%WIN%\php.ini file in a text editor (Notepad will work). Search for the line that looks like --> ;extension=php_mysql.dll Change this line to --> extension=php_mysql.dll Uncomment: extension_dir="c:\php\ext" Save the modified php.ini file. 6. Copy php.ini to C:\%WIN%\System32 7. Copy C:\PHP\libmysql.dll and C:\PHP\ext\php_mysql.dll to the C:\%WIN%\system32 folder. Restart Apache and test it out. Hope this helps! Share this post Link to post Share on other sites