Annotation of embedaddon/php/ext/pdo_dblib/tests/bug_47588.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: PDO_DBLIB: Quoted field names
! 3: --SKIPIF--
! 4: <?php
! 5: if (!extension_loaded('pdo_dblib')) die('skip not loaded');
! 6: require dirname(__FILE__) . '/config.inc';
! 7: ?>
! 8: --FILE--
! 9: <?php
! 10: require dirname(__FILE__) . '/config.inc';
! 11:
! 12: $db->query('CREATE TABLE "Test Table" ("My Field" int, "Another Field" varchar(32) not null default \'test_string\')');
! 13: $db->query('INSERT INTO "Test Table" ("My Field") values(1)');
! 14: $db->query('INSERT INTO "Test Table" ("My Field") values(2)');
! 15: $db->query('INSERT INTO "Test Table" ("My Field") values(3)');
! 16: $rs = $db->query('SELECT * FROM "Test Table"');
! 17: var_dump($rs->fetchAll(PDO::FETCH_ASSOC));
! 18: $db->query('DROP TABLE "Test Table"');
! 19: echo "Done.\n";
! 20: ?>
! 21: --EXPECT--
! 22: array(3) {
! 23: [0]=>
! 24: array(2) {
! 25: ["My Field"]=>
! 26: string(1) "1"
! 27: ["Another Field"]=>
! 28: string(11) "test_string"
! 29: }
! 30: [1]=>
! 31: array(2) {
! 32: ["My Field"]=>
! 33: string(1) "2"
! 34: ["Another Field"]=>
! 35: string(11) "test_string"
! 36: }
! 37: [2]=>
! 38: array(2) {
! 39: ["My Field"]=>
! 40: string(1) "3"
! 41: ["Another Field"]=>
! 42: string(11) "test_string"
! 43: }
! 44: }
! 45: Done.
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>