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 cultivated=0 order by llid' at line 1--select * from observations where date_format(from_unixtime(o_time),"%Y")= and cultivated=0 order by llid