[REVIEW] database->getTableFields

Last reviewed: Not reviewed
phpDocumentor

database->getTableFields

Returns a list of fields and field types given a list of tables.

Syntax

array getTableFields ( array $tables )

$tablesis an array containing a simple list of table names.

Examples

Example:

function generateSQL() {
  global $database;
 
  $prefix = $database->_table_prefix;
  $tables = array( $prefix.'content_frontpage', $prefix.'content_rating' );
  $result = $database->getTableFields( $tables );
  print_r( $result );
}
 
generateSQL();

might produce:

Array
(
    [jos_content_frontpage] => Array
        (
            [content_id] => int
            [ordering] => int
        )
 
    [jos_content_rating] => Array
        (
            [content_id] => int
            [rating_sum] => int unsigned
            [rating_count] => int unsigned
            [lastip] => varchar
        )
 
)

Please report any errors on this page to the Developer Documentation Forum.

Last Updated ( Monday, 25 December 2006 )