I keep getting this:
[0] => Array
(
[0] => Array
(
[thread_id] => 136
[owner_id] => 1
[subject] => asdhjkasdh
[body] => askjdhaksjd
[timestamp] => 2012-03-22 22:03:51
[slug] => asdhjkasdh
)
)
[1] => Array
(
[0] => Array
(
[thread_id] => 137
[owner_id] => 1
[subject] => asdhjkasdh
[body] => askjdhaksjd
[timestamp] => 2012-03-22 22:03:56
[slug] => asdhjkasdh
)
)
But I need each [0] and [1] to contain the data, not another array.
Here is my code: The initial query returns the thread_id in array form. I then use the thread_id to pull the info from the thread table. Though I can't seem to organize it correctly in the array.
$query = $this->db->query($sql);
$result = $query->result_array();
$thread = array();
foreach ($result as $thread_id)
{
$id = $thread_id['thread_id'];
$query = $this->db->query("SELECT * FROM thread WHERE thread_id='$id'");
array_push($thread, $query->result_array());
}
print_r($thread);
return $thread;
Thanks!