如果執行代碼使用,它顯示了錯誤:權語法近的順序按id DESC LIMIT 1
check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY ID DESC limit 1'
就像下面的例子:
$prevquery = "SELECT * FROM $tbl_name WHERE ID < $ID ORDER BY ID DESC limit 1";
$prevresult= mysql_query($prevquery) or die(mysql_error());
while($prevrow = mysql_fetch_row($prevresult))
{
displaying the previous ID:-
$prevID = $prevrow['ID'];
}
應該怎樣一個做防止這個?
什麼是$ tbl_name和$ ID? – mvp
請向我們展示'$ prevquery'包含的內容。 – Barmar