note 56612 added to function.mysql-result
| From: | php-general at lists dot php dot net | Date: | Fri, 09 Sep 2005 08:25:59 +0000 |
| Subject: | note 56612 added to function.mysql-result | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-94938@lists.php.net to get a copy of this message | ||
wow this's exactly what i was looking for, but there's a bug, just replace
for($i = 0; $i < count($row); $i++) {
for($i = 0; $i < mysql_num_fields($result); $i++) {
function mysql_result_all($result) {
echo '<table>';
for($i = 0; $i < mysql_num_fields($result); $i++) {
echo '<th>';
echo mysql_field_name($result,$i);
echo '</th>';
}
while($row = mysql_fetch_array($result)) {
echo '<tr>';
for($i = 0; $i < count($row); $i++) {
echo '<td>'.$row[$i].'</td>';
}
echo '</tr>';
}
echo '</table>';
}
----
Manual Page -- http://www.php.net/manual/en/function.mysql-result.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+56612
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56612&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56612&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56612&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56612&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56612&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56612&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+56612&report=yes
Search -- http://master.php.net/manage/user-notes.php