Error - Division by zero ?

hi all, i got stuck with this error in cgridview and cannot resolve it.

please somebody help me.




PHP Error

Description


Division by zero

Source File


D:\xampp\htdocs\yii-113\framework\base\CComponent.php(616) : eval()'d code(1)


No source code available.


Stack Trace


#0 D:\xampp\htdocs\yii-113\framework\base\CComponent.php(616): eval()

#1 D:\xampp\htdocs\yii-113\framework\zii\widgets\grid\CGridColumn.php(128): CDataColumn->evaluateExpression()

#2 D:\xampp\htdocs\yii-113\framework\zii\widgets\grid\CGridView.php(457): CDataColumn->renderDataCell()

#3 D:\xampp\htdocs\yii-113\framework\zii\widgets\grid\CGridView.php(430): CGridView->renderTableRow()

#4 D:\xampp\htdocs\yii-113\framework\zii\widgets\grid\CGridView.php(343): CGridView->renderTableBody()

#5 D:\xampp\htdocs\yii-113\framework\zii\widgets\CBaseListView.php(158): CGridView->renderItems()

#6 unknown(0): CGridView->renderSection()

#7 D:\xampp\htdocs\yii-113\framework\zii\widgets\CBaseListView.php(141): preg_replace_callback()

#8 D:\xampp\htdocs\yii-113\framework\zii\widgets\CBaseListView.php(127): CGridView->renderContent()

#9 D:\xampp\htdocs\yii-113\framework\web\CBaseController.php(166): CGridView->run()

#10 D:\xampp\htdocs\internal\protected\views\t_surat\admin.php(208): T_suratController->widget()

#11 D:\xampp\htdocs\yii-113\framework\web\CBaseController.php(119): require()

#12 D:\xampp\htdocs\yii-113\framework\web\CBaseController.php(88): T_suratController->renderInternal()

#13 D:\xampp\htdocs\yii-113\framework\web\CController.php(798): T_suratController->renderFile()

#14 D:\xampp\htdocs\yii-113\framework\web\CController.php(739): T_suratController->renderPartial()

#15 D:\xampp\htdocs\internal\protected\controllers\T_suratController.php(336): T_suratController->render()

#16 D:\xampp\htdocs\yii-113\framework\web\actions\CInlineAction.php(32): T_suratController->actionAdmin()

#17 D:\xampp\htdocs\yii-113\framework\web\CController.php(300): CInlineAction->run()

#18 D:\xampp\htdocs\yii-113\framework\web\filters\CFilterChain.php(129): T_suratController->runAction()

#19 D:\xampp\htdocs\yii-113\framework\web\filters\CFilter.php(41): CFilterChain->run()

#20 D:\xampp\htdocs\yii-113\framework\web\CController.php(1049): CAccessControlFilter->filter()

#21 D:\xampp\htdocs\yii-113\framework\web\filters\CInlineFilter.php(59): T_suratController->filterAccessControl()

#22 D:\xampp\htdocs\yii-113\framework\web\filters\CFilterChain.php(126): CInlineFilter->filter()

#23 D:\xampp\htdocs\yii-113\framework\web\CController.php(283): CFilterChain->run()

#24 D:\xampp\htdocs\yii-113\framework\web\CController.php(257): T_suratController->runActionWithFilters()

#25 D:\xampp\htdocs\yii-113\framework\web\CWebApplication.php(324): T_suratController->run()

#26 D:\xampp\htdocs\yii-113\framework\web\CWebApplication.php(121): CWebApplication->runController()

#27 D:\xampp\htdocs\yii-113\framework\base\CApplication.php(135): CWebApplication->processRequest()

#28 D:\xampp\htdocs\internal\index.php(12): CWebApplication->run()


2010-07-13 21:27:43 Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1 Yii Framework/1.1.3



thanks…

Can you show the value expressions you use in your grid column definition? You are probably doing some invalid calculation there. It should be somewhere around line 208 of protected\views\t_surat\admin.php.

hi mike, thanks for reply.

so this error not related to database field value?

most likely miss of quote or something ? am I right ?

this my cgridview code.

i set type raw in value column




...

$columns[] =array(

	'filter'=>false,

	'type'=>'raw',

	'value'=>'$this->grid->dataProvider->pagination->currentPage*$this->grid->dataProvider->pagination->pageSize + $row+1',

	'htmlOptions'=>array('style'=>'width:20px;text-align:center'),

	'cssClassExpression'=>'$data->Nomor_Surat=='.$selected.' ? \'selected_row\' : \'\' '

);


...


	$this->widget('zii.widgets.grid.CGridView', array(

		'id'=>'t-surat-grid',

		'dataProvider'=>$model->search(),

		'filter'=>$model,

		'columns'=>$columns,

		'summaryCssClass'=>'summary_manage',

	)); 



i have isolated everything but still not a clue…

This seems OK… but that’s not all columns… maybe is in some other column?