admin管理员组文章数量:1433896
I have sql query:
$query= "SELECT * FROM files ORDER BY id DESC LIMIT $from, $site WHERE custom > 0";
but not work, i have notice:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax
What i do wrong?
I have sql query:
$query= "SELECT * FROM files ORDER BY id DESC LIMIT $from, $site WHERE custom > 0";
but not work, i have notice:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax
What i do wrong?
Share Improve this question edited Jul 21, 2019 at 23:31 Jaron asked Apr 6, 2019 at 21:01 JaronJaron 458 bronze badges 1- Order by has to be after where. – Howard E Commented Apr 6, 2019 at 21:16
1 Answer
Reset to default 2You have the where
clause of the query in the wrong place.
Your query should be written like this:
$query= "SELECT *
FROM files
WHERE custom > 0
ORDER BY id DESC
LIMIT $from, $site";
As specified here https://dev.mysql/doc/refman/8.0/en/select.html in the MySQL reference.
本文标签: pluginsSQL queryerror
版权声明:本文标题:plugins - SQL query, error 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745307192a2652716.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论