Error : 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 slh.date_end' at line 47
SELECT s.structure_name, s.notes, sp.structure_name AS parent_name, sp.structure_id AS parent_id, sg.structure_name AS grandparent_name, sg.structure_id AS grandparent_id, sl.location, sl.structure_location_id, slh.event, slh.date_start, slh.date_end, slh.structure_location_history_id, slh.notes AS event_note, sa.architect_id, sa.note, FROM structure s LEFT JOIN structure sp ON (s.parent_id = sp.structure_id) LEFT JOIN structure sg ON (sp.parent_id = sg.structure_id) LEFT JOIN structure_location sl ON (sl.structure_id = s.structure_id AND sl.structure_location_id = '') LEFT JOIN structure_location_history slh ON (slh.structure_id = s.structure_id AND slh.structure_location_id = sl.structure_location_id) LEFT JOIN structure_architect sa ON (sa.structure_id = s.structure_id AND sa.structure_location_id = sl.structure_location_id AND sa.structure_location_history_id = slh.structure_location_history_id) LEFT JOIN architect a ON (a.architect_id = sa.architect_id) WHERE s.structure_id = ORDER BY slh.date_end
There has been an error, cannot query database, please try again later.