所以下面的代码已被窃听了我一下:PDO诠释占位符,让他们身边的报价
$stm = $pdo->prepare("SELECT * FROM urls WHERE account=? AND NOT deleted LIMIT ?, 4");
$stm->execute($user, ($request-1)*4);
每当我执行这个查询返回此错误:
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 ''0', 4' at line 1'
在寻找它它似乎使用?除非使用bindParam指定,否则占位符会自动将引号置于其周围。有没有办法解决这个问题,而不必使用bingparam函数?
您还可以[关闭仿真模式](http://stackoverflow.com/tags/pdo/info) –
@YourCommonSense是否有任何副作用? – lemondrop
@lemondrop如果您需要使用PDO访问不同类型的数据库,则会导致查询失败,但是MySQL可以将其中大部分数据排序。 – Jon