-1
我試圖通過mysqli查詢獲取數據。 查詢看起來像:MySqli和PHP:不在聲明
SELECT * FROM pxldr_drawings
ORDER BY RAND()
WHERE id NOT IN (1,3,4,2)
LIMIT 1
,但我得到了以下錯誤消息
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 'WHERE id NOT IN (1,3,4,2) LIMIT 1' at line 3
我也試過NOT IN ('1','3','4','2')
和NOT IN(1,3,4,2)
,但既不工作。
感謝,LB
你的ORDER BY和WHERE子句是錯誤的順序。將它們交換。 – andrewsi