2
PostgreSQL pg_escape_bytea() functions
4
<?php include("skipif.inc"); ?>
11
$image = file_get_contents(dirname(__FILE__) . '/php.gif');
12
$esc_image = pg_escape_bytea($image);
14
$db = pg_connect($conn_str);
15
pg_query($db, 'INSERT INTO '.$table_name.' (num, bin) VALUES (9876, \''.$esc_image.'\');');
16
$result = pg_query($db, 'SELECT * FROM '.$table_name.' WHERE num = 9876');
17
$rows = pg_fetch_all($result);
18
$unesc_image = pg_unescape_bytea($rows[0]['bin']);
20
if ($unesc_image !== $image) {