Welcome Guest, Not a member yet? Register   Sign In
Why is foreach not working?
#5

[eluser]Kraig[/eluser]
I've been messing around with this for awhile now...could it be something with my query results?
Code:
function get_files()
{
  $userID = $this->session->userdata('id');  
  $query = $this->db->query('SELECT * FROM upload WHERE userID = '.$userID);
  $num_row = $query->num_rows();
  $val = $query->row_array();

  $test ="";
  foreach ($query->result_array() as $row)
  {
     $test .= $row['id'];
     $test .= $row['name'];
  }
  return $test;
}


Messages In This Thread
Why is foreach not working? - by El Forum - 08-16-2012, 05:53 PM
Why is foreach not working? - by El Forum - 08-16-2012, 05:59 PM
Why is foreach not working? - by El Forum - 08-16-2012, 06:05 PM
Why is foreach not working? - by El Forum - 08-16-2012, 06:08 PM
Why is foreach not working? - by El Forum - 08-16-2012, 06:22 PM
Why is foreach not working? - by El Forum - 08-16-2012, 06:36 PM
Why is foreach not working? - by El Forum - 08-16-2012, 06:45 PM
Why is foreach not working? - by El Forum - 08-16-2012, 06:51 PM
Why is foreach not working? - by El Forum - 08-16-2012, 06:59 PM
Why is foreach not working? - by El Forum - 08-16-2012, 07:07 PM
Why is foreach not working? - by El Forum - 08-16-2012, 07:11 PM
Why is foreach not working? - by El Forum - 08-16-2012, 07:15 PM
Why is foreach not working? - by El Forum - 08-16-2012, 07:22 PM
Why is foreach not working? - by El Forum - 08-16-2012, 07:34 PM
Why is foreach not working? - by El Forum - 08-16-2012, 09:23 PM
Why is foreach not working? - by El Forum - 08-16-2012, 10:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB