SQL SELECT 内部连接偏移
SQL SELECT INNER JOIN WHERE OFFSET
我正在尝试在我的网站上编写搜索栏代码,但是当我添加 WHERE .. LIKE 时出现错误。
$SELECT *
FROM articles
INNER JOIN fournisseur ON fournisseur.fournisseur_id = articles._fournisseur_id
ORDER BY ".$order." LIMIT ".$limit." OFFSET ".$debut."
WHERE article_designation LIKE ".$recherche."
这是错误消息:
Fatal error: 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 'WHERE article_designation LIKE aspirateur' at line 1' in
请求在没有 WHERE
的情况下也能正常工作。查询有什么问题?
您需要 WHERE
子句出现在 ORDER BY
或 LIMIT
之前
我正在尝试在我的网站上编写搜索栏代码,但是当我添加 WHERE .. LIKE 时出现错误。
$SELECT *
FROM articles
INNER JOIN fournisseur ON fournisseur.fournisseur_id = articles._fournisseur_id
ORDER BY ".$order." LIMIT ".$limit." OFFSET ".$debut."
WHERE article_designation LIKE ".$recherche."
这是错误消息:
Fatal error: 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 'WHERE article_designation LIKE aspirateur' at line 1' in
请求在没有 WHERE
的情况下也能正常工作。查询有什么问题?
您需要 WHERE
子句出现在 ORDER BY
或 LIMIT