note 24476 added to function.pg-escape-bytea

From: Date: Sat, 17 Aug 2002 13:56:25 +0000
Subject: note 24476 added to function.pg-escape-bytea
Groups: php.notes 
Request: Send a blank email to php-notes+get-35170@lists.php.net to get a copy of this message
if you need to change back bytea from the db to normal data, this will do that: function pg_unescape_bytea($bytea) { return eval("return \"".str_replace('$', '\\$', str_replace('"', '\\"', $bytea))."\";"); } // use like this $rs = pg_query($conn, "SELECT image from images LIMIT 1"); $image = pg_unescape_bytea(pg_fetch_result($rs, 0, 0)); /Tobias -- http://www.php.net/manual/en/function.pg-escape-bytea.php http://master.php.net/manage/user-notes.php?action=edit+24476 http://master.php.net/manage/user-notes.php?action=delete+24476 http://master.php.net/manage/user-notes.php?action=reject+24476

« previous php.notes (#35170) next »