è molto strano:
prova ad utilizzare mysql_error();
Codice PHP:
 $result =mysql_query ($query$db) or die(mysql_error());