I am trying to connect to my MySQL database on my online server via PHP on my localhost.
$con = mysql_connect(\"$hostname\", \"$username\", \"$password\"); i
It is time to move to mysqli_* or PDO
mysqli_*
PDO
Documentation