Source for file bind-dbtable.php
Documentation is available at bind-dbtable.php
// basic guestbook class that extends DB_Table
class GuestBook_Table extends DB_Table
var $idx = array (); // indices don't matter here
// multiple rows for a list
'select' => 'id, signdate, CONCAT(fname, " ", lname) AS fullname',
'order' => 'signdate DESC'
// instantiate the extended DB_Table class
// (using an existing database connection and the table name 'guestbook')
$guestbook = & new GuestBook_Table ($db, 'guestbook');
// Options for the bind() call
// (using the predefined query 'list' from the $sql array and a where
$options = array ('view' => 'list', 'where' => 'YEAR(signdate) = 2100');
// bind the guestbook object
// (if you don't generate any column yourself before rendering, three
// columns will be generated: id, signdate, fullname)
$test = $datagrid->bind ($guestbook, $options);
// print binding error if any
if (PEAR ::isError ($test)) {
echo $test->getMessage ();
Documentation generated on Mon, 11 Mar 2019 15:47:20 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|