The right syntax for mysql_query
is the opposite of your. From documentation
mixed mysql_query ( string $query [, resource $link_identifier = NULL ] )
So you need to change to
$result = mysql_query($sql,$con);
Since connection link is not required if you only use a database connection you migh not use it
$result = mysql_query($sql);
You might need to select your database after connection
bool mysql_select_db ( string $database_name [, resource $link_identifier = NULL ] )
As side note i would advise you to switch to either PDO
or mysqli
since mysql_*
api are deprecated and soon will be no longer mantained