SELECT gallery_id, gallery_name, gallery_descrip, parent_id, gallery_date FROM photo_gallery where gallery_status=1 AND parent_id= ORDER BY gallery_id DESC, gallery_name ASC - 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 gallery_id DESC, gallery_name ASC' at line 1