[eluser]Unknown[/eluser]
Hallo,
I'm working on CI 1.5.4, *nix server, Oracle db.
I'm having a strange bug with Active Record.
Let's say I have a model called myNewModel with this 2 methods:
Code:
function getFirstArray(){
$myFirstArray = array();
$this->db->select('*');
$this->db->from('firstTable');
$this->db->orderby("myOrderField", "desc");
$query = $this->db->get();
$myFirstArray = $query->result_array();
$query->free_result();
return $myFirstArray;
}
function getSecondArray(){
$mySecondArray = array();
$this->db->select('*');
$this->db->from('secondTable');
$this->db->orderby("myOtherOrderField", "desc");
$query = $this->db->get();
$mySecondArray = $query->result_array();
$query->free_result();
return $mySecondArray;
}
First method gets a long list of stuff (articles i.e.).
Second method gets a list of 3 items (category i.e.).
When I call from my controller:
Code:
$myFirstArray = $this->myNewModel->getFirstArray();
$mySecondArray= $this->myNewModel->getSecondArray();
to pass data to the view, $myFirstArray is filled up with lots of records, and $mySecondArray has the same contents.
It seems like if CI has executed first query again (query executed and freeed in method getFirstArray() ) without resetting queries object, ignoring my second query ( in method getSecondArray() ).
I printed $this->db to screen from within the second method, and the object CI_DB_oci8_driver->queries has 2 queries in it.
I have $db["cache_on"] set to FALSE, anyway I tried to force cache delete and cache off before preparing select with active record, nothing to do... :-(
Somebody had my same problem?
I had a look in the forum search but didn't find anything...
thanks in advance to everybody
Alex