Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 02ba8d21b8629c7c26ab200593b8d752 > files > 19

php-pear-Structures_DataGrid-0.9.3-2.mga4.noarch.rpm

<?php
$datagrid =& new Structures_DataGrid();

// Replace this with your database access informations:
$bindOptions['dsn'] = "mysql://foo:bar@host/world";

// The City table contains 5 fields: ID, Name, CountryCode, District and Population
$datagrid->bind("SELECT * FROM City ORDER BY Population", $bindOptions);

// We want to remove the ID field, so we retrieve a reference to the Column:
$column =& $datagrid->getColumnByField('ID');

// And we drop that column:
$datagrid->removeColumn($column);

// This will only render 4 fields: Name, CountryCode, District and Population:
$datagrid->render();
?>