Traceback (most recent call last): File "/data/www/ecun/app.py", line 7240, in get cur.execute("select id,title,goods.img,price,unit,goods.sid,domain,qh from goods left join cun on goods.sid=cun.cunid where "+que+" channelid<3000 and isdel=0 order by id desc") File "/usr/lib64/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute self.errorhandler(self, exc, value) File "/usr/lib64/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler raise errorclass, errorvalue ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'and channelid<3000 and isdel=0 order by id desc' at line 1")