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 `entities_categories`.id = `entities`.category AND `entities`.active = 1' at line 1
SELECT `entities`.*,`entities_categories`.area FROM `entities`,`entities_categories` WHERE `entities`.id =  AND `entities_categories`.id = `entities`.category AND `entities`.active = 1