I have this function in my model:
public function get_current_knowledge($account_id)
{
$query = $this->db->query('SELECT * FROM knowledge WHERE account_id = ?', array($account_id));
return $query->result_array();
}
I used to access it like this:
while ($record = $this->synchronization_model->get_current_knowledge($account['id'])) {
print_r($record);
}
But strangely, my page would timeout probably because the while results in a neverending loop or something? But why is the question.
I noticed that foreach does work. But essentially this should return the same as while right? When accessing it like this, using foreach:
foreach ($this->synchronization_model->get_current_knowledge($account['id']) as $row)
{
print_r($row);
}