note 37649 added to function.mysql-result
| From: | tooley311 at yahoo dot com | Date: | Fri, 21 Nov 2003 22:29:18 +0000 |
| Subject: | note 37649 added to function.mysql-result | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-60774@lists.php.net to get a copy of this message | ||
For those who use odbc and appreciate using the odbc_result_all utility function, here's the
same thing, spelled out, for mysql. No error checking, sorry.
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+37649
Delete -- http://master.php.net/manage/user-notes.php?action=delete+37649&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+37649&report=yes
Search -- http://master.php.net/manage/user-notes.php