Login   Register  
PHP Classes
elePHPant
Icontem

File: example2.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Andrej Bodor  >  deadatagrid  >  example2.php  >  Download  
File: example2.php
Role: Example script
Content type: text/plain
Description: datagrid
Class: deadatagrid
Display MySQL query results in an HTML table
Author: By
Last change:
Date: 5 years ago
Size: 1,261 bytes
 

Contents

Class file image Download
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Example 2 Datagrid</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<script language="javascript" type="text/javascript" src="util.js"></script>
</head>
<body>
<?php 
require 'datagrid.class.php';
require 
'dbconfig.php';

$conn mysql_connect(DB_HOSTDB_USERDB_PASSWORD) or die('Connection to database failed: ' mysql_error());
mysql_select_db(DB_NAME) or die ('select_db failed!');

$grid = new Datagrid($conn);
$grid->baselink 'example2.php';

$grid->setFrom('lang_forms');

$grid->setMaxNavLinks(4);
$grid->setRowsPerPage(5);

$grid->rowformat "<ul%s>%s</ul>\n";
$grid->fieldformat "<li>%s</li>";
$grid->navfirst 'First ';
$grid->navlast ' Last';
$grid->navprev 'Prev. ';
$grid->navnext ' Next';
?>
<div id="h_d">
<strong>Sample diferent formating</strong>
<br><br>
<div><?php echo $grid->getRows(); ?></div>
<div id="navlinks"><?php echo $grid->getFoot();?></div>
</div>
<div id="h_t" style="visibility:hidden; background-color:white; border: 0px solid black;"></div>
</body>
</html>