i have mysql database over cpanel, i want to access through my localhost page..
<?php
$con1 = mysql_connect("mywebsiteip","mysql_username","mysql_user_password");
if(!$con1)
{
die ("Could not connect " . mysql_error());
}
else
{
echo "Good connection";
}
mysql_close($con1);
?>
When i run it, it cannot connect to mysql database over cpanel. and i even tried up
$con1 = mysql_connect("mywebsiteip:portnumber","mysql_username","mysql_user_password");
Can any let me know, which one is good way. Below is the image or error

mysql_error()?