|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-09-12 16:45 UTC] iliaa@php.net
-Status: Open
+Status: Bogus
[2011-09-12 16:45 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 19:00:01 2025 UTC |
Description: ------------ The test script below shows the point best. One thing to notice, is that this bug only happens when you have standard_conforming_strings set to "on" in your postgres.conf file. It seems like the fact that PHP uses '\' as escape char might be messing things up, sd $pdo->quote("\\") return '\' when standard_conforming_strings is set to "on" vs, '\\' when it's off. Test script: --------------- $pdo = new PDO($dns, $username, $password); $statement = $pdo->prepare("SELECT table.* FROM table table WHERE (column ILIKE :db_condition_placeholder_0 ESCAPE " . $pdo->quote("\\") . ") AND (column ILIKE :db_condition_placeholder_1 ESCAPE " . $pdo->quote("\\") . ");"); $statement->execute(array(':db_condition_placeholder_0' => 'test', ':db_condition_placeholder_1' => 'test')); Expected result: ---------------- No errors and query executed: Actual result: -------------- Error produced: Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: :db_condition_placeholder_1 in