In addition to the information found in the default output, a notation of the number of columns is provided by the num_fields element while the order element provides an array with the column names as the keys and their location index number (corresponding to the keys in the default output) as the values.
If a result set has identical field names, the last one is used.
Similar to DB_TABLEINFO_ORDER but adds more dimensions to the array in which the table names are keys and the field names are sub-keys. This is helpful for queries that join tables which have identical field names.
The query result has multiple columns with the same name. PHP's Informix extension deals with columns having the same names by overwriting the prior columns information. Therefore, tableInfo() is unable to properly represent these result sets.
Use aliases for columns that have the same names.
Note
This function can not be called statically.
tableInfo() is not portable because not all drivers have this capability and the data returned by each DBMS varies wildly.
<?php // Once you have a valid DB object named $db... $result =& $db->query('SELECT * FROM tablename'); $info = $db->tableInfo($result); print_r($info); ?>
Deliver First Class Web Sites: 101 Essential Checklists Want to learn how to make your web sites usable and accessible? Want to ensure that your sites meet current best practice, without spending hours trawling through incomprehensible specifications and recommendations from dozens of different books, research papers, and web sites? Want to make sure that the sites you build are "right the first time," requiring no costly redevelopments?