Source for file desc_tables.php
Documentation is available at desc_tables.php
* Examples how to show the fields of a given table.
* This example simply reads out all table names available for your schema,
* take the first shown table and calls the method "DescTable()" with the found
* tablename. Afterwards this table structure is dumped on screen.
* @author Sascha 'SieGeL' Pfalz <php@saschapfalz.de>
* @version 0.37 (11-Jul-2009)
* $Id: desc_tables.php,v 1.1 2009/07/11 18:00:42 siegel Exp $
* @license http://opensource.org/licenses/bsd-license.php BSD License
require
('functions.inc.php');
// Retrieve the first available table:
$stmt =
$db->QueryResult('SHOW TABLES');
while($table =
$db->FetchResult($stmt,MYSQL_NUM))
die('ERROR: No table found?? Please create at least one table to describe.'.
$d['LF']);
$tfields =
$db->DescTable($table[0]);
printf('%sTable %s has %d fields:%s%s',$d['LF'],$table[0],count($tfields),$d['LF'],$d['LF']);
print
('Fieldname | Type/Size | Flags'.
$d['LF']);
print
('---------------------------------+--------------------+----------------------'.
$d['LF']);
for($i =
0; $i <
count($tfields); $i++
)
Documentation generated on Sat, 07 Aug 2010 10:18:09 +0200 by phpDocumentor 1.4.3