error 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 'OR static.ID = ORDER BY static.rank ASC' at line 4 (SELECT static.*,parent.name AS parentname FROM static LEFT JOIN static AS parent ON parent.ID = static.parent WHERE static.parent= OR static.ID = ORDER BY static.rank ASC)