-2

I hit this error when running a PHP script on XAMPP, in Windows. Does anyone know how solved it?

Fatal error: Call to undefined function mysql_connect() in C:\xampp\htdocs\netbanking\dbconnection.php on line 2.

Yohanes Gultom
  • 3,592
  • 2
  • 24
  • 35
Mr.deva
  • 3
  • 3
  • 7

1 Answers1

0

Try:

<?php
  phpinfo();
?>

Create and call the page with above code and search for mysql. If not found, Do the following things.

Open your php.ini and

Changed from

;extension=php_mysql.so

into

extension=php_mysql.so

NOTE: mysql extension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0. Instead, the MySQLi or PDO_MySQL extension should be used.

Hassaan
  • 6,770
  • 5
  • 29
  • 47