写了一个利用pear自动生成datagrid的代码,但是不知道为什么,不报错,但是什么东西都显示不出来。。请哪位高手解答,谢谢。
其中服务器为localhost,数据库叫userinformation,用户名root,密码为空,数据库里那个表是users
<?php
require_once 'Structures/DataGrid.php';
$dataGrid = new Structures_DataGrid(2);
$options=array('dsn'=>"mysql://root:@localhost/userinformation");$sql="select * from users";
$bind = $dataGrid ->bind($sql,$options);if(PEAR::isError($bind))
{
    error_log($bind->getMessage());
    $gridSource='';    }
else
{
   $columns = array(
   'login' => 'login',
 'first_name' => 'first_Name',
 'last_name' => 'last_Name',
 'email' => 'email',
 'signature' => 'Signature',
 );
 $dataGrid->generateColumns($columns);
 $renderer_options = array(
 'sortIconASC' => '⇑',
 'sortIconDESC' => '⇓',
 'headerAttributes' => array('bgcolor' => '#E3E3E3'), 'evenRowAttributes' => array('bgcolor' => '#A6A6A6'), ); $datagrid->setRendererOptions($renderer_options); $renderer = $datagrid->getRenderer(); $renderer->setTableAttribute('cellspacing', 0); $renderer->setTableAttribute('cellpadding', 5); $renderer->setTableAttribute('border', 1);
 $gridbody = $datagrid->getOutput();
 if (PEAR::isError($gridbody))
 {
 error_log('DataGrid render error: ' .
 $gridbody->getMessage());
 $gridbody = '';
 }
 $gridpager = $datagrid->getOutput(DATAGRID_RENDER_PAGER);
 if (PEAR::isError($gridpager))
 {
 error_log('DataGrid render error: ' .
 $gridpager->getMessage());
 $gridpager = '';
 }
 $gridSource = $gridbody . $gridpager;
}?><html>
<?phpecho $gridSource;
?>
</html>