/ Published in: PHP
It uses a variable with a RecordSet from a ADOdb Library (Library must be downloaded). db_query PHP Functions can be used to have the REcordSet(http://snipplr.com/view/59379/dbquery-php-function-for-ddbb-queries-with-adodb-library/)
Then uses ADODB php library functions and properties for fill the tables with the data of the RecordSet.
Then uses ADODB php library functions and properties for fill the tables with the data of the RecordSet.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<table> <thead> <tr> <?php for($k=0; $k<= $RecordSet->FieldCount( ) -1 ; $k++){ $field = $RecordSet->FetchField($k); echo "<th>". $field->name."</th>"; } ?> </tr> </thead> <tbody> <?php while( !$RecordSet->EOF){ echo"<tr>"; for($k=0; $k<= $RecordSet->FieldCount( ) -1 ; $k++){ echo "<td>".$RecordSet->fields[$k]."</td>"; } echo"</tr>"; $RecordSet->MoveNext(); } ?> </tbody> </table>
URL: http://phplens.com/adodb/