-2

I am fresh of PHP language. My PHP Version is 7.0.1 .When I connect mysql with mysql_connect() function , I get the following error. When I change mysqli_connect() method to coneect database, it is working fine. But I want to used mysql_connect() because I'll test other people sample project that used mysql method.

 Fatal error: Uncaught Error: Call to undefined function mysql_connect() in D:\xwampp\htdocs\HMS\config.php:3 Stack trace: #0 D:\xwampp\htdocs\HMS\index.php(5): require() #1 {main} thrown in D:\xwampp\htdocs\HMS\config.php on line 3
Chan Lay
  • 71
  • 8

1 Answers1

2

when you have code that use mysql, you should change your PHP version below PHP7 like php 5 because these function deprecated in oldest version of PHP so the code shouldn't be built on these mysql functions and will be removed from newest versions.

Gouda Elalfy
  • 6,558
  • 1
  • 24
  • 37