You are here

function db_encode_blob in Drupal 6

Same name in this branch
  1. 6 includes/database.mysqli.inc \db_encode_blob()
  2. 6 includes/database.mysql.inc \db_encode_blob()
  3. 6 includes/database.pgsql.inc \db_encode_blob()
Same name and namespace in other branches
  1. 4 includes/database.mysqli.inc \db_encode_blob()
  2. 4 includes/database.mysql.inc \db_encode_blob()
  3. 4 includes/database.pgsql.inc \db_encode_blob()
  4. 5 includes/database.mysqli.inc \db_encode_blob()
  5. 5 includes/database.mysql.inc \db_encode_blob()
  6. 5 includes/database.pgsql.inc \db_encode_blob()

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

1 call to db_encode_blob()
_db_query_callback in includes/database.inc
Helper function for db_query().

File

includes/database.pgsql.inc, line 342
Database interface code for PostgreSQL database servers.

Code

function db_encode_blob($data) {
  return "'" . pg_escape_bytea($data) . "'";
}