Welcome Guest, Not a member yet? Register   Sign In
Problem creating a helper (Error undefined offset)
#1

[eluser]yoelrodguez[/eluser]
Hi I had problems with this helper that I created in codeigniter me this error is generated (Message: Undefined offset: 2) in the line:
($ iten == $ array [$ v])? $ found = true $ found ='';
happened also the code of the function:
$v = 0;
foreach($array as $key => $value){

$data = array(
$campo2=>$value,
$campo1=>$id
);

$ci->db->where($campo1, $id);
$qi = $ci->db->get($tabla);

foreach($qi->result() as $rows){

$found = false;
$iten = $rows->$campo2;

($iten == $array[$v])? $found = true: $found = '';

if($found == false){
$ci->db->insert($tabla,$data);
}
$v++;
}
}




Theme © iAndrew 2016 - Forum software by © MyBB