note 92294 added to function.pg-escape-bytea
| From: | gglocknerATNOSPAMdwafflerDOTcom at osu1 dot php dot net | Date: | Fri, 17 Jul 2009 21:13:51 +0000 |
| Subject: | note 92294 added to function.pg-escape-bytea | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-158433@lists.php.net to get a copy of this message | ||
If you're getting errors about nonstandard use of \\ in a string literal, then you need to
escape the encoded bytea as follows:
$escaped = pg_escape_bytea($data);
pg_query("INSERT INTO gallery (name, data) VALUES ('Pine trees',
E'$escaped'::bytea)");
----
Server IP: 69.147.83.197
Probable Submitter: 76.245.47.24
----
Manual Page -- http://www.php.net/manual/en/function.pg-escape-bytea.php
Edit -- https://master.php.net/note/edit/92294
Del: integrated -- https://master.php.net/note/delete/92294/integrated
Del: useless -- https://master.php.net/note/delete/92294/useless
Del: bad code -- https://master.php.net/note/delete/92294/bad+code
Del: spam -- https://master.php.net/note/delete/92294/spam
Del: non-english -- https://master.php.net/note/delete/92294/non-english
Del: in docs -- https://master.php.net/note/delete/92294/in+docs
Del: other reasons-- https://master.php.net/note/delete/92294
Reject -- https://master.php.net/note/reject/92294
Search -- https://master.php.net/manage/user-notes.php