I had a website built in PHP a good few years back and my provider has now upgraded to PHP 7.
I'm not getting the error Fatal error: Uncaught Error: Call to undefined function mysql_connect(). I have some HTML knowledge but no PHP. From researching I can see that mysql_* functions have been removed from PHP 7.
Can anyone help with the code so I can get it working again?
<?php
$username="cwuser";
$password="XXXXX";
$database="cwdb";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM car ORDER BY j_price DESC";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
?>