gpt4 book ai didi

mysql - PDO 查询语法错误

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

<分区>

你能告诉我这个查询有什么问题吗?我一直在寻找将近一个小时,但我看不到任何语法错误..

$query = $database->connection->prepare(
"SELECT
n.from_id AS friend_id,
n.type AS type,
n.created_date AS time,
u.user_profile_picture AS profile_picture,
u.user_firstname AS friend_firstname,
u.user_lastname AS friend_lastname,
FROM notifications n INNER JOIN users u ON u.user_id = n.from_id
WHERE n.to_id = :user_id AND n.checked = 1");

$query->bindValue(':user_id', $user_id, PDO::PARAM_STR);
$query->execute();

这是错误:

Uncaught exception 'PDOException' with message

'SQLSTATE[42000]: Syntax error or access violation: 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 'FROM notifications n INNER JOIN users u ON u.user_id = n.from_id WHERE n.to_id =' at line 8' in

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