Welcome Guest, Not a member yet? Register   Sign In
my "sizeof" doesn't work
#2

[eluser]CroNiX[/eluser]
I think its fine. It looks like your problem is your return is within your loop, so it will only go through the loop once and return no matter how many elements are in the $checkBox array.

As a side note, foreach() is faster than using manual iteration...
Code:
$checkBox = $this->input->post('checked');

foreach($checkBox as $i => $value)
{
      $this->db->where('id_edu',$checkBox[$i]);  
}
//now that you have built up the where statements, execute and return the whole query...
return $this->db->get($this->tbl);


Messages In This Thread
my "sizeof" doesn't work - by El Forum - 04-20-2011, 11:23 AM
my "sizeof" doesn't work - by El Forum - 04-20-2011, 11:31 AM
my "sizeof" doesn't work - by El Forum - 04-20-2011, 12:13 PM
my "sizeof" doesn't work - by El Forum - 04-20-2011, 12:26 PM
my "sizeof" doesn't work - by El Forum - 04-20-2011, 01:17 PM



Theme © iAndrew 2016 - Forum software by © MyBB