Could just use while ($row = $this->db... instead of if...do...