note 19766 added to function.mysql-field-type

From: Date: Sun, 10 Mar 2002 11:13:16 +0000
Subject: note 19766 added to function.mysql-field-type
Groups: php.notes 
Request: Send a blank email to php-notes+get-27579@lists.php.net to get a copy of this message
The field type returns what PHP classifies the data found in the field, not how it is stored in the database; use the following example to retrieve the MySQL information about the field.... $USERNAME = ''; $PASSWORD = ''; $DATABASE = ''; $TABLE_NAME = ''; mysql_connect('localhost', $USERNAME, $PASSWORD) or die ("Could not connect"); $result = mysql_query("SHOW FIELDS FROM $DATABASE.$TABLE_NAME"); $i = 0; while ($row = mysql_fetch_array($result)) { echo $row['Field'] . ' ' . $row['Type']; } -- http://www.php.net/manual/en/function.mysql-field-type.php http://master.php.net/manage/user-notes.php?action=edit+19766 http://master.php.net/manage/user-notes.php?action=delete+19766 http://master.php.net/manage/user-notes.php?action=reject+19766

« previous php.notes (#27579) next »