Download src/php/php-src/ext/odbc/tests/bug68087.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 1.22 kB
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/odbc/tests/bug68087.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/odbc/tests/bug68087.phpt
-
curl -L -o bug68087.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/odbc/tests/bug68087.phpt
1.22 kB
| --TEST-- | |
| odbc_exec(): Getting accurate date data from query | |
| --EXTENSIONS-- | |
| odbc | |
| --SKIPIF-- | |
| include 'skipif.inc'; | |
| --FILE-- | |
| include 'config.inc'; | |
| $id_1_date = '2014-09-23'; | |
| $id_2_date = '2014-09-24'; | |
| $conn = odbc_connect($dsn, $user, $pass); | |
| odbc_exec($conn, 'CREATE TABLE bug68087 (ID INT, VARCHAR_COL VARCHAR(100), DATE_COL DATE)'); | |
| odbc_exec($conn, "INSERT INTO bug68087(ID, VARCHAR_COL, DATE_COL) VALUES (1, 'hello', '$id_1_date'), (2, 'helloagain', '$id_2_date')"); | |
| $res = odbc_exec($conn, 'SELECT * FROM bug68087 ORDER BY ID ASC'); | |
| while(odbc_fetch_row($res)) { | |
| $id = odbc_result($res, "ID"); | |
| $varchar_col = odbc_result($res, "VARCHAR_COL"); | |
| $date = odbc_result($res, "DATE_COL"); | |
| if ($id == 1) { | |
| if ($date != $id_1_date) { | |
| print "Date_1 mismatched\n"; | |
| } else { | |
| print "Date_1 matched\n"; | |
| } | |
| } else { | |
| if ($date != $id_2_date) { | |
| print "Date_2 mismatched\n"; | |
| } else { | |
| print "Date_2 matched\n"; | |
| } | |
| } | |
| } | |
| --CLEAN-- | |
| include 'config.inc'; | |
| $conn = odbc_connect($dsn, $user, $pass); | |
| odbc_exec($conn, 'DROP TABLE bug68087'); | |
| --EXPECT-- | |
| Date_1 matched | |
| Date_2 matched | |