Invalid Query: select events_sponsors.sl_id, sponsors.s_name, sponsors.s_website, sponsors.s_image from events_sponsors left outer join sponsors on (events_sponsors.s_id = sponsors.s_id) where events_sponsors.e_id = order by events_sponsors.sl_id asc, sponsors.s_name asc Error is: 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 'order by events_sponsors.sl_id asc, sponsors.s_name asc' at line 1