note 37649 deleted from function.mysql-result by aidan

From: Date: Fri, 09 Sep 2005 08:41:47 +0000
Subject: note 37649 deleted from function.mysql-result by aidan
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-94952@lists.php.net to get a copy of this message
Note Submitter: tooley311 at yahoo dot com ---- 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>'; }

« previous php.notes (#94952) next »