kpetsche20 Posted November 13, 2008 Share Posted November 13, 2008 Hello I'm trying to use a PEAR table but I am getting this error. <?php // Include the DB access credentials require '../dbcred.php'; // Include the PEAR Structures_DataGrid class require 'Structures/DataGrid.php'; error_reporting(E_ALL); // Custom Output Callback Functions function ge($data) { $link = $data['record']['Product_URL']; return $link; } $datagrid = new Structures_DataGrid(10); // Add Custom Columns $name = new Structures_DataGrid_Column("Product_URL", "Product_URL", "Product_URL", null, null, "ge()"); $datagrid->addColumn($name); // Add Default Sort $datagrid->setDefaultSort(array('Product_URL' => 'ASC')); $options = array('dsn' => "mysql://$user:$password@$db_host/$db_name"); $sql = "SELECT * FROM csv"; // Bind the Query to our Datagrid $bind = $datagrid->bind($sql, $options); // Test for Errors if (PEAR::isError($bind)) { error_log('DataGrid Error: '. $bind->getMessage()); $gridsource = ''; } else { $renderer_options = array( 'sortIconASC' => '<img src="images/up.gif" />', 'sortIconDESC' => '<img src="images/down.gif" />', 'headerAttributes' => array('bgcolor' => '#E3E3E3'), 'evenRowAttributes' => array('bgcolor' => '#A6A6A6'), ); $datagrid->setRendererOptions($renderer_options); $renderer = $datagrid->getRenderer(); $renderer->setTableAttribute('width', '100%'); $renderer->setTableAttribute('cellspacing', 0); $renderer->setTableAttribute('cellpadding', 5); $renderer->setTableAttribute('border', 1); // Render the table, be sure to check for errors $gridbody = $datagrid->getOutput(); if (PEAR::isError($gridbody)) { error_log('DataGrid render error: ' . $gridbody->getMessage()); $gridbody = ''; } // Finally, render the pager, again checking for errors $gridpager = $datagrid->getOutput(DATAGRID_RENDER_PAGER); if (PEAR::isError($gridpager)) { error_log('DataGrid render error: ' . $gridpager->getMessage()); $gridpager = ''; } $gridsource = $gridbody . $gridpager; } ?> <!DOCTYPE html public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>PEAR::Structures_DataGrid, Customized!</title> <meta http-equiv="Content-type" content="text/html; charset=iso-8859-1" /> <style type="text/css"> body { font-family: Tahoma, Arial, Helvetica, sans-serif; font-size: 11px; } h1 { font-size: 1.2em; color: navy } img { border: none; } </style> </head> <body> <h1>DataFeed Manager</h1> <?php echo $gridsource; ?> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/132561-pear-error/ Share on other sites More sharing options...
.josh Posted November 13, 2008 Share Posted November 13, 2008 getting what error? Quote Link to comment https://forums.phpfreaks.com/topic/132561-pear-error/#findComment-689298 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.