我做了這個:PHP的SQL錯誤(來自順序,其中位置)
$query1=mysql_query("select id, testo, titolo from events order by DESC WHERE id < 225 LIMIT 1");
while($query2=mysql_fetch_array($query1))
{
echo $query2['titolo'];
}
但不工作,我不明白爲什麼,有人能幫助我嗎? 我認爲問題出在查詢中。
更新:我犯了兩個錯誤:
第一:我已經在ORDER BY子句中缺少列名。 第二:ORDER的位置
無法使用你看在手冊? http://dev.mysql.com/doc/refman/5.7/en/select.html。 'select ... from ... where ... order ... limit'。 – chris85
@ chris85酷解釋:) – devpro
@ chris85:感謝您的鏈接。我已經添加它在我的答案:) –