db_encode_blob

includes/database.pgsql.inc, line 342

Versions
4.6 – 6
db_encode_blob($data)

Returns a properly formatted Binary Large OBject value. In case of PostgreSQL encodes data for insert into bytea field.

Parameters

$data Data to encode.

Return value

Encoded data.

Related topics

Code

<?php
function db_encode_blob($data) {
  return "'". pg_escape_bytea($data) ."'";
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.