bug_47588.phpt 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. $db->query('CREATE TABLE "Test Table" ("My Field" int, "Another Field" varchar(32) not null default \'test_string\')');
  12. $db->query('INSERT INTO "Test Table" ("My Field") values(1)');
  13. $db->query('INSERT INTO "Test Table" ("My Field") values(2)');
  14. $db->query('INSERT INTO "Test Table" ("My Field") values(3)');
  15. $rs = $db->query('SELECT * FROM "Test Table"');
  16. var_dump($rs->fetchAll(PDO::FETCH_ASSOC));
  17. $db->query('DROP TABLE "Test Table"');
  18. echo "Done.\n";
  19. ?>
  20. --EXPECT--
  21. array(3) {
  22. [0]=>
  23. array(2) {
  24. ["My Field"]=>
  25. string(1) "1"
  26. ["Another Field"]=>
  27. string(11) "test_string"
  28. }
  29. [1]=>
  30. array(2) {
  31. ["My Field"]=>
  32. string(1) "2"
  33. ["Another Field"]=>
  34. string(11) "test_string"
  35. }
  36. [2]=>
  37. array(2) {
  38. ["My Field"]=>
  39. string(1) "3"
  40. ["Another Field"]=>
  41. string(11) "test_string"
  42. }
  43. }
  44. Done.