-1

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

guys,I am developing a free hosting website in awardspce.net ,everything worked fine but when i am trying to connect a php page to mysql server,i get error.Actually any mysql_* command gives me error but if i use mysqli instead of mysql, no error message is given but i am not sure that everything works fine.Can u tell me the difference between them? enter image description here

Apurba A
  • 71
  • 6

1 Answers1

0
  • PHP old mysql_* function are removed from PHP 7.*
  • if you have PHP 5.* hosting, you must install or enable mysql extension
  • install PHP 5.* mysql extension apt-get install php5.6-mysql, but better upgrade PHP app to use PDO or mysqli extensions
Pavel Musil
  • 504
  • 2
  • 12
  • I am hosting my webpages in server of awardspace.net and using there database management system,so how can i run "apt-get install php5.6-mysql" command? Or,can u tell if i use my_sqli instead of that,i will not face any problem? thank u – Apurba A Apr 01 '20 at 14:39
  • On webhosting systems you must check configuration in the hosting's account. The `apt-get` will not work. You may add ` – Pavel Musil Apr 01 '20 at 15:41
  • update:i successfully solved the issue,i used mysqli_ instead of mysql_,then worked. – Apurba A Jun 11 '20 at 13:53