An Error Was Encountered
Error Number: 1064
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 alp_asc_parties.level = ORDER BY alp_competitions.id' at line 8
SELECT alp_competitions.id AS champ_id, alp_competitions.ch_name, alp_competitions.place, alp_competitions.ch_date0 AS d0, alp_competitions.ch_date1 AS d1, alp_discipline.name AS discipline, alp_asc_parties.chief AS chief, alp_hardship.name AS hard FROM alp_asc_parties INNER JOIN alp_act_ascents ON alp_asc_parties.host_element_id = alp_act_ascents.id INNER JOIN alp_routes ON alp_act_ascents.route = alp_routes.id INNER JOIN alp_competitions ON alp_act_ascents.champ_id = alp_competitions.id INNER JOIN alp_discipline ON alp_competitions.discipline = alp_discipline.id INNER JOIN alp_hardship ON alp_routes.hardship = alp_hardship.id WHERE alp_asc_parties.party = AND alp_asc_parties.level = ORDER BY alp_competitions.id;