xref: /PHP-7.1/ext/pgsql/tests/15pg_delete.phpt (revision 953ee61a)
1--TEST--
2PostgreSQL pg_delete()
3--SKIPIF--
4<?php include("skipif.inc"); ?>
5--FILE--
6<?php
7error_reporting(E_ALL);
8
9include 'config.inc';
10
11$db = pg_connect($conn_str);
12
13$fields = array('num'=>'1234', 'str'=>'XXX', 'bin'=>'YYY');
14$ids = array('num'=>'1234');
15echo pg_delete($db, $table_name, $ids, PGSQL_DML_STRING)."\n";
16echo pg_delete($db, $table_name, $ids, PGSQL_DML_STRING|PGSQL_DML_ESCAPE)."\n";
17if (!pg_delete($db, $table_name, $ids)) {
18	echo "Error\n";
19}
20else {
21	echo "Ok\n";
22}
23?>
24--EXPECT--
25DELETE FROM "php_pgsql_test" WHERE "num"=1234;
26DELETE FROM "php_pgsql_test" WHERE "num"='1234';
27Ok
28