Welcome Guest, Not a member yet? Register   Sign In
Nontrivial active records question
#3

[eluser]Cristian Gilè[/eluser]
Hi german.zvonchuk,

I don't test it but could work:

Code:
$skip = FALSE;
foreach($_POST as $key => $value_array) {
    foreach($value_array as $value) {
        if( ! $skip)
        {
         $this->db->where($key, $value);
         $skip = TRUE;
        }
        else
        {
         $this->db->or_where($key, $value);
         $skip = FALSE;
        }
    }            
}
$this->db->from('item');
$this->db->count_all_results();


Messages In This Thread
Nontrivial active records question - by El Forum - 01-06-2011, 02:45 AM
Nontrivial active records question - by El Forum - 01-06-2011, 02:48 AM
Nontrivial active records question - by El Forum - 01-06-2011, 04:18 AM
Nontrivial active records question - by El Forum - 01-06-2011, 06:50 AM
Nontrivial active records question - by El Forum - 01-06-2011, 07:02 AM



Theme © iAndrew 2016 - Forum software by © MyBB