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

[eluser]german.zvonchuk[/eluser]
I tried this code:
Code:
foreach($_POST as $key => $value_array) {
    foreach($value_array as $value) {
        $this->db->or_where($key, $value);
    }            
}
$this->db->from('item');
$this->db->count_all_results();

but it din't produced the result I need.

Result:
Code:
SELECT COUNT(*) AS `numrows`
FROM (`item`)
WHERE
`id_item_type` = '1'
OR `id_item_type` = '2'
OR `id_street` = '158'
OR `id_street` = '209'
OR `id_item_target` = '1'
OR `id_item_target` = '2'


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