Questo è più un problema da PHP.
Devi farti restituire l'errore, con mysql_error()