[eluser]eric cumbee[/eluser]
im not sure what is going on, i am passing an array into my model and loop through it creating or_where statements. the problem i am running into is that if i pass in a value like "Statesboro" when the query is executed the sql statement is something like this
Code:
SELECT COUNT(*) AS `numrows`
FROM (`voters`)
WHERE `reg_city` = 'S'
and then this is my model function
Code:
function count_voter($city) {
if($city) {
foreach($city as $row)
{
$this->db->or_where('reg_city',$row['reg_city']);
}
}
$this->db->from('voters');
$count = $this->db->count_all_results();
return $count;
}
i have traced the data flowing all the way back from my view to the controller, and then the data being passed to the model from the controller, so i know for sure that the data is making it through the view and the controller with out being concatenated.