在pdo
When this query is prepared, the % signs will be encapsulated in quotes, resulting in a query like this:SELECT * FROM tbl WHERE address LIKE '%"foo"%' OR address LIKE '%"bar"%'
Consequently, the query will not return any results because the double quotes破坏类似运算符的预期功能。
要纠正此问题,应该将%符号包含在参数中:使用此修改,准备好的查询将正确搜索包含$ var1或$ var2的地址。
免责声明: 提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发到邮箱:[email protected] 我们会第一时间内为您处理。
Copyright© 2022 湘ICP备2022001581号-3