note 15620 added to function.mysql-num-fields
| From: | matt at iwdt dot net | Date: | Sun, 23 Sep 2001 22:09:28 +0000 |
| Subject: | note 15620 added to function.mysql-num-fields | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-18221@lists.php.net to get a copy of this message | ||
here's one way to print out a row of <th> tags from a table
NOTE: i didn't test this
$result = mysql_query("select * from table");
for ($i = 0; $i < mysql_num_fields($result); $i++) {
print "<th>".mysql_field_name($result, $i)."</th>\n";
}
post a comment if there's an error
--
http://www.php.net/manual/en/function.mysql-num-fields.php
http://master.php.net/manage/user-notes.php?action=edit+15620
http://master.php.net/manage/user-notes.php?action=delete+15620
http://master.php.net/manage/user-notes.php?action=reject+15620