I'm attempting to loop through an array and use the rows(values) as the conditions for my SQL query but I can't seem to get it loop through the rows. It only outputs the data for the first row where the form_name = ' V243823' then stops. i need all the rows, so 3 arrays total to be returned.
Campus Forms Array
[0] => Array
(
[PQ_Lookup] => V243823
[RL_Lookup] => B3823RL
[MA_Lookup] => F356823
)
Query
foreach( $campus_forms[0] as $key => $row )
{
$this->db->select('form_deadline,form_url,form_fullname');
$this->db->from('form_deadlines');
$this->db->where('form_name', $row);
$query = $this->db->get();
if ($query->num_rows() > 0)
{
$campus_forms = $query->result_array();
return $campus_forms;
}
}
$new_forms = array(); array_push($new_forms, $campus_forms);would that be best?