syntax error: SELECT * FROM table_products_one WHERE display = 1 AND id_second_nomen_one = ORDER BY order_num DESC 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 order_num DESC' at line 1