Welcome Guest, Not a member yet? Register   Sign In
two different queries returning same data
#1

[eluser]tjmthome[/eluser]
Hi, I need some help, with a strange behavior of CI or maybe im too novice.
Im working with Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi

Code:
//in a MODEL i have some funcions with queries
function getUsers(){
  $qryUsrs = $this->db>query('select * from users');
  return $qryUsrs->result_array();
}
function getDocs(){
  $qryDocs = $this->db>query('select * from documents');
  return $qryDocs->result_array();
}

//in my CONTROLLER i call both
$this->load->model('qry_model');
$data['users'] = $this->qry_model->getUsers();

// Here im trying to clean the array
$this->db->result_array = array();

$data['docs'] = $this->qry_model->getDocs();
$this->load->view('my_view',$data);

//in my VIEW I display both queries each in a table
echo $this->table->generate($users);
if($users === $docs) echo 'THE ARRAYS HAVE THE SAME DATA....'; //This always print
echo $this->table->generate($docs);

The problem is that in both tables I get exactly the same data, i suppose i need to ‘clear’ the info in the array before getting another, someone knows how i must to proceed to get the correct data in each table?

Thanks in advance


Messages In This Thread
two different queries returning same data - by El Forum - 06-10-2008, 11:38 AM
two different queries returning same data - by El Forum - 06-10-2008, 03:59 PM
two different queries returning same data - by El Forum - 06-11-2008, 08:20 AM
two different queries returning same data - by El Forum - 06-11-2008, 08:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB