我正在尝试在php和mysql中进行LIKE查询,但我一直收到错误。有谁知道答案?
$addedquery = "WHERE name LIKE '%".$keyword."%'";
You have an error in your SQL syntax; check the manual that corresponds to your MySQL `enter code here`server version for the right syntax to use near 'WHERE name LIKE '%%'' at line 1
答案 0 :(得分:1)
这是您的完整查询吗?你错过了首发:
$addedquery = "SELECT * FROM table WHERE name LIKE '%".$keyword."%'";