note 94623 added to function.pg-query-params
| From: | olivier dot berger at it-sudparis dot eu | Date: | Sun, 15 Nov 2009 11:12:42 +0000 |
| Subject: | note 94623 added to function.pg-query-params | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-162923@lists.php.net to get a copy of this message | ||
In addition to the note #71912 by "dt309 at f2s dot com", the ANY queries for string
values need to be encoded with double quotes, something like :
<?php
//...
$query = 'SELECT * FROM table1 WHERE col1 = ANY ($1)';
$result = pg_query_params($query, array('{"foo", "bar"}'));
?>
(see examples of other such syntax in chapter "8.14. Arrays" of prostgres docs).
So the valuelist construction with implode must be adapted to add the necessary double quotes.
----
Server IP: 69.147.83.197
Probable Submitter: 82.238.14.130
----
Manual Page -- http://www.php.net/manual/en/function.pg-query-params.php
Edit -- https://master.php.net/note/edit/94623
Del: integrated -- https://master.php.net/note/delete/94623/integrated
Del: useless -- https://master.php.net/note/delete/94623/useless
Del: bad code -- https://master.php.net/note/delete/94623/bad+code
Del: spam -- https://master.php.net/note/delete/94623/spam
Del: non-english -- https://master.php.net/note/delete/94623/non-english
Del: in docs -- https://master.php.net/note/delete/94623/in+docs
Del: other reasons-- https://master.php.net/note/delete/94623
Reject -- https://master.php.net/note/reject/94623
Search -- https://master.php.net/manage/user-notes.php