Fatal error: Call to undefined function mysql_connect() in C:\Apache\htdocs\test.php on line 2
Uncomment the line extension=php_mysql.dll
in your "php.ini" file and restart Apache.
Additionally, "libmysql.dll" file must be available to Apache, i.e., it must be either in available in Windows systems PATH or in Apache working directory.
See more about installing MySQL extension in manual.
P.S. I would advise to consider MySQL extension as deprecated and to use MySQLi or even PDO for working with databases (I prefer PDO).
Fatal error: Uncaught Error: Call to undefined function mysql_connect()
mysql_*
functions have been removed in PHP 7.
You probably have PHP 7 in XAMPP. You now have two alternatives: MySQLi and PDO.
Undefined function mysql_connect()
Well, this is your chance! It looks like PDO is ready; use that instead.
Try checking to see if the PHP MySQL extension module is being loaded:
<?php
phpinfo();
?>
If it's not there, add the following to the php.ini
file:
extension=php_mysql.dll
Related Topics
How to Remove Empty Values from Multidimensional Array in PHP
Understanding PHP "Out of Memory" Error
How to Display Images from a Folder Using PHP - PHP
How to Destroy Session with Browser Closing in Codeigniter
Validate That Input String Does Not Exceed Word Limit
Should I Use Both Striptags() and HTMLspecialchars() to Prevent Xss
How to Get Average of Column Values in Laravel
Follow Redirects with Curl in PHP
How to Add Custom Fonts in Tcpdf
How to Get List of Supported Encodings by Iconv Library in PHP
JSON Encode an Entire MySQL Result Set
Ftp Upload File to Distant Server with Curl and PHP Uploads a Blank File