pg_escape_bytea − escapes a binary string for inclusion into SQL statements.
pg_escape_bytea string
pg_escape_bytea escapes a binary string, making it safe for inclusion into SQL statements.
pg_exec $conn "insert into foo values ([pg_escape_binary $name]);"
binary_string
The binary string to be escaped.
Returns the binary string, escaped for inclusion into SQL queries.