note 36453 added to function.pg-escape-string

From: Date: Thu, 09 Oct 2003 23:27:51 +0000
Subject: note 36453 added to function.pg-escape-string
Groups: php.notes 
Request: Send a blank email to php-notes+get-58172@lists.php.net to get a copy of this message
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. ---- Manual Page -- http://www.php.net/manual/en/function.pg-escape-string.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+36453 Delete -- http://master.php.net/manage/user-notes.php?action=delete+36453&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+36453&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#58172) next »