Demeteor Demeteor - 22 days ago 12
MySQL Question

Fatal error: Uncaught Error: Call to undefined function mysql_connect()

I am trying to do a simple connection with XAMPP and sql server.
but when ever I try to enter data or connect to the database, I get this error.


Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\xampp\htdocs\register.php:22

Stack trace: #0 {main} thrown in C:\xampp\htdocs\register.php on line 22


Example of line 22:

$db = mysql_connect($mysql_hostname , $mysql_username)

Answer

mysql_* functions have been removed in PHP7!

You probably have a php7 in XAMPP Please use PDO and... Feel the power of the light side:)

Link to nice wiki page about :)

PDO