neel
(Kazi Neel)
1
PHP implode function is not working.
?
?
public function actionMultiupdate()
{
$this->_model=Test::model()->updateAll(array("User_id"=>0),"id IN (" .implode(",",$_POST["cid"]).")");
$this->redirect(array(‘admin’));
}
I got this error
Description
implode() [<a href=‘function.implode’>function.implode</a>]:
Invalid arguments passed
neel
(Kazi Neel)
3
This is my view file
<?php $this->widget(‘zii.widgets.grid.CGridView’, array(
‘dataProvider’=>$dataProvider,
‘columns’=>array(
‘id’,
array(
‘name’=>‘Action’, ‘value’=>‘CHtml::checkBox(“cid[]”,null,array(“value”=>$data->id,“id”=>“cid_”.$data->id))’,
‘type’=>‘raw’,
‘htmlOptions’=>array(‘width’=>5),
//‘visible’=>false,
),
‘name’,
‘email’,
),
)); ?>
and controller
public function actionMultiupdate()
{
$this->_model=Test::model()->updateAll(array("User_id"=>0),"id IN (" .implode(",",$_POST["cid"]).")");
$this->redirect(array(‘admin’));
}
Can you help me where is the problem?
kiniu
(Kiniuuwr)
4
Check in your controller action if $_POST[‘cid’] is not null.
insun
(657981142)
5
",$_POST[“cid”] maybe is not an array ,so it hints that Invalid arguments passed 