Invece di eseguire la query, falla stampare e vediamo esattamente com'e' composta.

In altre parole invece di mysql_query(....) metti echo(....)