bug_47588.phpt 978 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. --TEST--
  2. PDO_DBLIB: Quoted field names
  3. --EXTENSIONS--
  4. pdo_dblib
  5. --SKIPIF--
  6. <?php
  7. require __DIR__ . '/config.inc';
  8. ?>
  9. --FILE--
  10. <?php
  11. require __DIR__ . '/config.inc';
  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. int(1)
  27. ["Another Field"]=>
  28. string(11) "test_string"
  29. }
  30. [1]=>
  31. array(2) {
  32. ["My Field"]=>
  33. int(2)
  34. ["Another Field"]=>
  35. string(11) "test_string"
  36. }
  37. [2]=>
  38. array(2) {
  39. ["My Field"]=>
  40. int(3)
  41. ["Another Field"]=>
  42. string(11) "test_string"
  43. }
  44. }
  45. Done.