• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
two different queries returning same data

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 - 64bi

//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
$data['users'] = $this->qry_model->getUsers();

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

$data['docs'] = $this->qry_model->getDocs();

//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

[eluser]Derek Allard[/eluser]
You betcha. $this->table->clear() should do it for you.

Hi, sorry Derek. I already tried this (table.clear), and i get the same data.

As you can see I evaluate $users vs $docs and i see that the info is the same.

please another suggestion.

[eluser]Derek Allard[/eluser]
I see that you've already got this exact question in another thread (where I see this was already suggested) so I feel a bit like I've wasted both our time here. I'm closing this thread to keep all discussion in one place.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.