note 36453 deleted from function.pg-escape-string by pollita
| From: | pollita@php.net | Date: | Fri, 10 Oct 2003 05:11:46 +0000 |
| Subject: | note 36453 deleted from function.pg-escape-string by pollita | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-58177@lists.php.net to get a copy of this message | ||
Note Submitter: Jan Fredrik Leversund
----
Here's something that wasted a couple of hours of my time:
If you use sprintf() to construct queries, your strings will be automagically escaped. So if you do
like I did...
<?php
$lala = " ' ";
$query = sprintf("select * from lalatable where lalafield = '%s'",
pg_escape_string($lala));
?>
...your string will actually be escaped twice over.