PHP/MySQL simple connection won’t work

hostingMySQLPHP

I'm hosting a website on Zymic (free host) that utilizes MySQL. I opened an account, and wrote the SIMPLEST function to connect to the DB. It looks like this:

<?php
    $conn = mysql_connect("uuuq.com","paulasplace_sudo","mypassword");
    if(!$con)
    {
        die("Could not connect: " . mysql_error());
    }
    else
    {
        echo("mysql connected successfully!");
    }
?>

but it throws this error:

Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 111 in /www/uuuq.com/p/a/u/paulasplace/htdocs/index.php on line 9
Could not connect: Lost connection to MySQL server at 'reading initial communication packet', system error: 111

Any ideas what might be wrong?

Best Answer

This may be just from when you copied the code into your post, but you store the results of mysql_connect() into $conn, but the if statement checks a different variably $con...