gpt4 book ai didi

php - 内部连接语句上的 mysql 语法错误

转载 作者:太空宇宙 更新时间:2023-11-03 11:11:41 24 4
gpt4 key购买 nike

我想从两个表中获取最后 5 行。

这是我执行的mysql语句:

"SELECT title, thread_id
FROM threads AS t1
JOIN ON comments AS c1 ON t1.user_id = c1.user_id
WHERE t1.user_id=".$userID
." OR c1.user_id=".$userID.
" ORDER BY thread_id DESC
LIMIT 0,5"

这里是错误的:

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 'ON comments AS c1 ON t1.user_id = c1.user_id WHERE t1.user_id=1 OR c1.' at line 3

我做错了什么?!?

最佳答案

comments 之前有多余的 ON

关于php - 内部连接语句上的 mysql 语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8104114/

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