-5

Pls can someone help me fix this error?

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\xampp\htdocs\library1\library\connection.php:2 Stack trace: #0 C:\xampp\htdocs\library1\login.php(39): include() #1 {main} thrown in C:\xampp\htdocs\library1\library\connection.php on line 2

u_mulder
  • 54,101
  • 5
  • 48
  • 64
Jean R
  • 1
  • 1
  • 2
  • 2
    mysql-extension is __deprecated and removed__ in php7. Unless you use some legacy code - __forget__ about `mysql`, otherwise see comment above. – u_mulder Jun 13 '17 at 07:10

2 Answers2

0

try to use mysqli_connect() instead of mysql_connect() statement. It is an improved version of mysql.

B.Rahul
  • 1
  • 1
0

mysql functions have been removed in PHP7 XAMPP So, Please Use PDO Or My_Sqli To Avoid This.

PDO will work on 12 different database systems, where as MySQLi will only work with MySQL databases.

PDO: https://www.w3schools.com/php/php_mysql_connect.asp

MY_Sqli: https://www.w3schools.com/php/php_mysql_connect.asp

NOTE:

mysql_connect — Open a connection to a MySQL Server Warning This 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.

RïshïKêsh Kümar
  • 4,734
  • 1
  • 24
  • 36