if($limit== '400'){
$sql="SELECT * FROM report ORDER BY reportID ASC LIMIT $limit WHERE userID='$reportID'";}
说"You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE userID='147'' at line 1"
。
任何可以帮助我的人。我是php编程语言的初学者。
答案 0 :(得分:2)
Where
子句应放在Order By
尝试一下:
if($limit== '400'){
$sql="SELECT * FROM report WHERE userID='$reportID' ORDER BY reportID ASC LIMIT $limit";
}