Hi, i am having a action in the cakephp controller as which takes the report_id as an argument and the Selected Fields as an array .
i am trying to compare the array that contains the already existing attribute ids with the array what i have received from the action post .. if that particular attribute id if not present in the received array then i am trying to delete that entry in the Report s table.. i am not aware of how to use the NOt equal to operator in this scenario . Help me please.......
function updateReport($report_id){
$attribute_ids=$this->params['form']['attr'];
$comma_separated = explode(",", $attribute_ids);
$count=count($comma_separated);
//$comma_separated contains 200,203
$exists=$this->Report->find('all',array('conditions'=>array('Report.report_id'=>$report_id)));
//$exists contains the attributes as 200 , 201, 203
foreach($exists as $exist){
for($i=0;$i<$count;$i++){
if($exist['Report']['attribute_id']==$comma_separated[$i]){
echo "not in array $comma_separated ".$exist['Report']['attribute_id'];echo " ";
}
}
}
}