Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Felver Yepez  >  Recordset  >  example.php  >  Download  
File: example.php
Role: ???
Content type: text/plain
Description: Example
Class: Recordset
Author: By
Last change:
Date: 13 years ago
Size: 1,139 bytes
 

Contents

Class file image Download
<?
	include "Recordset.php";

	$db_connection = odbc_connect("fordDSN", "sa", "collective");
	
	$sql = "SELECT * FROM catalogo";

	$rs = new Recordset($db_connection, $sql);
	
	$rs->Elems(8);

	if(!isset($page))
		$page = 1;

	$results = $rs->Split($page);

	echo "<table border=\"0\">\r";
	echo "<tr bgcolor=\"#000000\">";
	echo "<td align=\"center\"><FONT FACE=\"Verdana, Arial\" SIZE=\"2\" COLOR=\"#FFFFFF\">C&oacute;digo</FONT></td>";
	echo "<td align=\"center\"><FONT FACE=\"Verdana, Arial\" SIZE=\"2\" COLOR=\"#FFFFFF\">Nombre</FONT></td>";
	echo "<td align=\"center\"><FONT FACE=\"Verdana, Arial\" SIZE=\"2\" COLOR=\"#FFFFFF\">Descripci&oacute;n</FONT></td>";
	echo "</tr>\r";

	for($i = 0; $i < count($results); $i++)
	{
		if( $i % 2 == 0)
			$color = "#0099CC";
		else
			$color = "#CCFFFF";
				
		echo "<tr bgcolor = \"$color\">";
		echo "<td>" . $results[$i]["cod_catalogo"] . "</td>";
		echo "<td>" . $results[$i]["nombre_catalogo"] . "</td>";
		echo "<td>" . $results[$i]["desc_catalogo"] . "</td>";
		echo "</tr>\r";
	}
	echo "</table>\r";

	$rs->DisplayGuide("example.php", $page);
?>