note 19765 added to function.mysql-fetch-field
| From: | krang at krang dot org dot uk | Date: | Sun, 10 Mar 2002 11:12:38 +0000 |
| Subject: | note 19765 added to function.mysql-fetch-field | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-27578@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-fetch-field.php
http://master.php.net/manage/user-notes.php?action=edit+19765
http://master.php.net/manage/user-notes.php?action=delete+19765
http://master.php.net/manage/user-notes.php?action=reject+19765