Hey all, I am not familiar with php coding at all and was wondering if anyone could help me re-code the below to being php 7 compatible. After using a php testor, it says mysql_connect is deprecated and needs to use the alternative mysqli_connect instead. How would I rewrite the below to be in the mysqli_connect format? Thank you in advance
<?php
$db = "MyDatabaseName"; //set this to the name of your database
$host = "localhost"; //set this to the name of your host
$user = "MyUserName"; //set this to your db user name
$pass = "MyPassword"; //set this to your db password
$con = mysql_connect("$host","$user","$pass");
$table = "MyDatabaseTableName"; //set this to the name of the table that holds the card info.
$con= mysql_connect("$host","$user","$pass");
if(!$con)
{
$connect_error = "Failed at mysql_connect. ";
echo"error at db connect";
exit();
}
$tablewidth = "490";//set the main table width on the spread pages with this.
$imagedirectory = "images/"; //main image directory
$largeimagedirectory = "images/medium/";
srand((double)microtime()*1000000);
?>