Home > PHP > Function > PostgreSQL > pg_escape_bytea()

pg_escape_bytea()

pg_escape_bytea - Escape a string for insertion into a bytea field

Syntax

string pg_escape_bytea (resource $connection, string $data)

Arguments

  • connection - PostgreSQL database connection resource. When connection is not present, the default connection is used. The default connection is the last connection made by pg_connect() or pg_pconnect().
  • data - A string containing text or binary data to be inserted into a bytea column.

Description

pg_escape_bytea() escapes string for bytea datatype. It returns escaped string.

Version

PHP 4.2.0, 5

Return value

A string containing the escaped data.