Fatal error: Uncaught Error: Call to undefined function mysql_connect() in F:\xampp\htdocs\hms\includes\database.php:7 Stack trace: #0 F:\xampp\htdocs\hms\init.php(8): db_connect() #1 F:\xampp\htdocs\hms\index.php(61): require_once('F:\xampp\htdocs...') #2 {main} thrown in F:\xampp\htdocs\hms\includes\database.php on line 7
Asked
Active
Viewed 3,354 times
-4

Rahul
- 18,271
- 7
- 41
- 60

Expert Suggestion
- 371
- 5
- 17
1 Answers
0
Acording to php.net:
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.

Morteza Nasiri
- 38
- 1
- 6
-
can you suggest me the php excat version so i not get this error.because online its run fine in 7.2.23 but not working in 7.0.30 and 7.0 – Expert Suggestion Oct 18 '19 at 06:33
-
I could not have run with v7.2 either. You need to go back to a 5.x version, but better to forget that api. – Shadow Oct 18 '19 at 06:52
-
1MySQLi or PDO_MySQL extension is better. – Morteza Nasiri Oct 18 '19 at 06:57