Suggerisci questo sito a Google

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 a.vacdiv = 1 AND a.id_albergo = o.id_albergo AND o.off' at line 4