Return to Snippet

Revision: 51786
at October 19, 2011 23:16 by alberomo


Updated Code
<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>

Revision: 51785
at October 4, 2011 06:13 by alberomo


Initial Code
<table>
	<thead>
		<tr>
		<?php
		for($k=0; $k<= $RecordSet->FieldCount( ) -1 ;  $k++){
			$field = $rsComunitats->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>

Initial URL
http://phplens.com/adodb/

Initial Description
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.

Initial Title
Table populated dinamically using ADODB php library code

Initial Tags
php

Initial Language
PHP