Welcome Guest, Not a member yet? Register   Sign In
Displaying all array values in a view. foreach not working for some reason.
#2

[eluser]pr0digy[/eluser]
Return is used only once, to return the function output. Here is what you should do:

Code:
function contact_values()
{
  $query = $this->db->get('column_data');
  
  $items = array();

  foreach($query->result_array() as $col_list)
  {
   $items[] = $col_list;
  }
  
  return $items;
}


Messages In This Thread
Displaying all array values in a view. foreach not working for some reason. - by El Forum - 07-24-2007, 05:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB