当我执行此查询时
SELECT
*
FROM
user
INNER JOIN friend
ON user.user_id = friend.friend_id
WHERE friend.user_id = :userId
ORDER BY user.firstName ASC
我收到此错误:
Error Code: 1064. 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 ':userId ORDER BY user.firstName ASC' at line 7
最佳答案
我认为你正在尝试直接在mysql中进行PHP的PDO查询,但是mysql无法获取它,尝试将:userId
替换为你想要比较的实际值,
关于mysql - 错误代码 : 1064. 您的 SQL 语法有错误;,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48615479/