gpt4 book ai didi

php - 按日期排序sql

转载 作者:行者123 更新时间:2023-12-01 00:13:33 25 4
gpt4 key购买 nike

我试图按日期排序表格,但出现此错误。

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 user_name = 'felipe' LIMIT 0, 5' at line 1

如果我删除 ORDER BY file_time 它会正常工作..

有什么想法吗?

mysql_query("SELECT * FROM files ORDER BY `file_time` WHERE `user_name` = '{$_SESSION['username']}' LIMIT $start, $per_page")

最佳答案

mysql_query("SELECT * FROM files WHERE `user_name` = '{$_SESSION['username']}' ORDER BY `file_time` LIMIT $start, $per_page")

关于php - 按日期排序sql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10904242/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com