我试图运行一个SQL查询,但它给这个错误,我有保留列在商店表和保留表,其中有名字,姓氏或电子邮件:
"SQLSTATE[42000]: Syntax or access violation: 1064 you have an error in your SQL syntax;
'FROM
reservations R
LEFT JOIN
'at line 11"
密码:
public function getReservationData($store = null, $limit = 10, $offset = 1)
{
$em = $this->getEntityManager();
$offset = ($offset -1) * $limit;
$query = "SELECT
R.FirstName as firstName,
R.LastName as lastName,
R.Email as email,
FROM reservaions R
LEFT JOIN
stores S
ON s.id = R.store
WHERE
s.id = :store
AND
S.reservation = 1";
$stmt->$this->getEntityManager()->getConnection->prepare($query);
$stmt->$bindParam(':store', $store);
$stmt->execute();
$result[] = $stmt->fetch();
return $result;
}
1条答案
按热度按时间b1zrtrql1#
请删除“”,这样就可以解决问题