Exception: Syntax error, unexpected token ), near to ' order by rand() LIMIT 6', when parsing: SELECT cc.seotxt,cc.seotitle,cs.img_url,cc.id,cecacon.cat_id FROM Uzn\Models\CelebsContent as cc, Uzn\Models\CelebsConnect as ccon, Uzn\Models\CelebsStatic as cs, Uzn\Models\CelebsCatConnect as cecacon WHERE cc.id=ccon.idc and cs.id=ccon.ids and cecacon.celeb_id=cc.id and cc.state=1 and cc.lang=1 and (cecacon.cat_id=) order by rand() LIMIT 6 (368)