Location: PHPKode > scripts > Eyesis Data Grid Control > eyesis-data-grid-control/ex3.php
require 'class.eyemysqladap.inc.php';
require 'class.eyedatagrid.inc.php';

// Load the database adapter
$db = new EyeMySQLAdap('localhost', 'root', '', 'codes');

// Load the datagrid class
$x = new EyeDataGrid($db);

// Set the query, select all rows from the people table
$x->setQuery("*", "people");

// Hide ID Column

// Show reset grid control

// Add standard control
$x->addStandardControl(EyeDataGrid::STDCTRL_EDIT, "alert('Editing %LastName%, %FirstName% (ID: %Id%)')");
$x->addStandardControl(EyeDataGrid::STDCTRL_DELETE, "alert('Deleting %Id%')");

// Add create control
$x->showCreateButton("alert('Code for creating a new person')", EyeDataGrid::TYPE_ONCLICK, 'Add New Person');

// Show checkboxes

// Show row numbers

// Change the amount of results per page

// Stop ordering
<title>EyeDataGrid Example 3</title>
<link href="table.css" rel="stylesheet" type="text/css">
<h1>Other options</h1>
<p>From the previous example a few things have changed:</p>
	<li>Row numbers are displayed</li>
	<li>Check boxes are available for each row</li>
	<li>The maximun number of results per page is now 4</li>
	<li>A reset, and create control was added to the top of the data grid</li>
	<li>Added controls edit and delete controls to each row</li>
	<li>Ordering data was disabled</li>
// Print the table
Return current item: Eyesis Data Grid Control