note 48350 added to function.mysql-field-name
| From: | jimharris at blueyonder dot co dot uk | Date: | Mon, 20 Dec 2004 14:28:35 +0000 |
| Subject: | note 48350 added to function.mysql-field-name | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-82087@lists.php.net to get a copy of this message | ||
The code in the last comment has an obvious mistake in the for loop expression. The correct
expression in the for-loop is $x<$y rather than $x<=$y...
$result = mysql_query($sql,$conn) or die(mysql_error());
$rowcount=mysql_num_rows($result);
$y=mysql_num_fields($result);
for ($x=0; $x<$y; $x++) {
echo = mysql_field_name($result, $x).'<br>';
}
----
Manual Page -- http://www.php.net/manual/en/function.mysql-field-name.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+48350
Delete -- http://master.php.net/manage/user-notes.php?action=delete+48350&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+48350&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+48350&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+48350&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+48350&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+48350&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+48350&report=yes
Search -- http://master.php.net/manage/user-notes.php