aggiungi un or die (mysql_error())

e poi, consiglio di leggibilità:

$sql = "tua query";
$result = mysql_query($sql, $db) or die (mysql_error());