Download src/php/php-src/ext/pgsql/tests/14pg_update.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 740 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pgsql/tests/14pg_update.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/pgsql/tests/14pg_update.phpt
-
curl -L -o 14pg_update.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pgsql/tests/14pg_update.phpt
740 Bytes
| --TEST-- | |
| PostgreSQL pg_update() | |
| --EXTENSIONS-- | |
| pgsql | |
| --SKIPIF-- | |
| include("inc/skipif.inc"); | |
| skip_bytea_not_escape(); | |
| --FILE-- | |
| error_reporting(E_ALL); | |
| include 'inc/config.inc'; | |
| $db = pg_connect($conn_str); | |
| $fields = array('num'=>'1234', 'str'=>'ABC', 'bin'=>'XYZ'); | |
| $ids = array('num'=>'1234'); | |
| pg_update($db, $table_name, $fields, $ids) or print "Error in test 1\n"; | |
| echo pg_update($db, $table_name, $fields, $ids, PGSQL_DML_STRING)."\n"; | |
| echo pg_update($db, $table_name, $fields, $ids, PGSQL_DML_STRING|PGSQL_DML_ESCAPE)."\n"; | |
| echo "Ok\n"; | |
| --EXPECT-- | |
| UPDATE "php_pgsql_test" SET "num"=1234,"str"=E'ABC',"bin"=E'XYZ' WHERE "num"=1234; | |
| UPDATE "php_pgsql_test" SET "num='1234',"str='ABC',"bin='XYZ' WHERE "num='1234'; | |
| Ok | |