1--TEST-- 2PDO::ATTR_FETCH_TABLE_NAMES 3--SKIPIF-- 4<?php 5require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc'); 6require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); 7MySQLPDOTest::skip(); 8?> 9--FILE-- 10<?php 11 require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); 12 $db = MySQLPDOTest::factory(); 13 MySQLPDOTest::createTestTable($db); 14 15 $db->setAttribute(PDO::ATTR_FETCH_TABLE_NAMES, 1); 16 $stmt = $db->query('SELECT label FROM test LIMIT 1'); 17 var_dump($stmt->fetchAll(PDO::FETCH_ASSOC)); 18 $stmt->closeCursor(); 19 20 $db->setAttribute(PDO::ATTR_FETCH_TABLE_NAMES, 0); 21 $stmt = $db->query('SELECT label FROM test LIMIT 1'); 22 var_dump($stmt->fetchAll(PDO::FETCH_ASSOC)); 23 $stmt->closeCursor(); 24 25 print "done!"; 26?> 27--EXPECTF-- 28array(1) { 29 [0]=> 30 array(1) { 31 ["test.label"]=> 32 string(1) "a" 33 } 34} 35array(1) { 36 [0]=> 37 array(1) { 38 ["label"]=> 39 string(1) "a" 40 } 41} 42done! 43