select DISTINCT S.sp_id,S.sp_name from q_packages AS P INNER JOIN q_club AS C ON C.cl_id=P.p_club INNER JOIN q_sports AS S ON S.sp_id=P.p_spid where cl_status=1 and P.p_status=1 and S.sp_catid= order by -P.p_id
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 -P.p_id' at line 4