I have upgraded php on my server from version 5 to 7 and I found out that mysql functions are depreciated and now I should use mysqli. I updated the following code (mysqli instead of mysql) that I used to print number of rows in a given table, but it doesn't work as it used to. Any help greatly appreciated.
$link = mysql_connect("xxx", "xxx", "xxx");
mysql_select_db("xxx", $link);
$result = mysql_query("SELECT * FROM blackandwhite", $link);
$num_rows = mysql_num_rows($result);
echo "$num_rows Rows
"; This works in PHP5
Updated code PHP7:
$link = mysqli_connect("xxx", "xxx", "xxx");
mysqli_select_db("xxx", $link);
$result = mysqli_query("SELECT * FROM blackandwhite", $link);
$num_rows = mysqli_num_rows($result);
echo "$num_rows Rows
"; This doesnt work anymore.