Could not successfully run query (select a.codice, a.descrizione, DATE_FORMAT(a.data_ora,'%d/%m/%Y') as data, b.tipo , a.note from aste a, AsteTipo b where a.pubblicata=1 and a.codice= and b.asta = a.codice) from DB: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and b.asta = a.codice' at line 1