14pg_update.phpt 629 B

1234567891011121314151617181920212223242526
  1. --TEST--
  2. PostgreSQL pg_update()
  3. --SKIPIF--
  4. <?php
  5. include("skipif.inc");
  6. skip_bytea_not_escape();
  7. ?>
  8. --FILE--
  9. <?php
  10. error_reporting(E_ALL);
  11. include 'config.inc';
  12. $db = pg_connect($conn_str);
  13. $fields = array('num'=>'1234', 'str'=>'ABC', 'bin'=>'XYZ');
  14. $ids = array('num'=>'1234');
  15. pg_update($db, $table_name, $fields, $ids) or print "Error in test 1\n";
  16. echo pg_update($db, $table_name, $fields, $ids, PGSQL_DML_STRING)."\n";
  17. echo pg_update($db, $table_name, $fields, $ids, PGSQL_DML_STRING|PGSQL_DML_ESCAPE)."\n";
  18. echo "Ok\n";
  19. ?>
  20. --EXPECT--
  21. UPDATE "php_pgsql_test" SET "num"=1234,"str"=E'ABC',"bin"=E'XYZ' WHERE "num"=1234;
  22. Ok