Getting same info with diferent queries - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Getting same info with diferent queries (/showthread.php?tid=9030) Pages:
1
2
|
Getting same info with diferent queries - El Forum - 06-09-2008 [eluser]tjmthome[/eluser] Hi, I need some help, with a strange behaivour of CI or maybe im too novice. Code: //in a MODEL i have some funcions with queries The problem is that in both tables I see 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 Getting same info with diferent queries - El Forum - 06-09-2008 [eluser]Armchair Samurai[/eluser] Try calling $this->table->clear() after generating the first table. Getting same info with diferent queries - El Forum - 06-09-2008 [eluser]tjmthome[/eluser] thanks Samurai, I tried your advise, but I have seen that the problem is in the returned array I placed a Code: if($users === $docs) im exploring the oci8_result.php to try to clean the array before populating. BTW im using Oracle. I see Code: function result_array() { Thanks Getting same info with diferent queries - El Forum - 06-09-2008 [eluser]gtech[/eluser] I think you are right it looks like an oddity with oracle. try Code: //result result array between generating the first and last table, then you will know if this is a bug or not. Getting same info with diferent queries - El Forum - 06-10-2008 [eluser]tjmthome[/eluser] Thanks gtech, I tried as you advised, im still getting same problem. I've been playing around with oci8_result.php, trying to clear the array, the resource, some times im getting some errors, but always getting the same data in both arrays. I think is time to post this problem in bugs area :down: Getting same info with diferent queries - El Forum - 06-10-2008 [eluser]gtech[/eluser] I also noticed that your code: Code: $qryDocs = $this->db>query('select * from documents'); should be Code: $qryDocs = $this->db->query('select * from documents'); is this a typo in the forums? you have done the same in the users function as well what do you get when you print_r after calling the model functions.. Code: ... Getting same info with diferent queries - El Forum - 06-11-2008 [eluser]tjmthome[/eluser] Thanks for your observation gtech, effectively is an typo (just in the forum, not in the code). When i print_r($data), yes, i can see that both arrays ($users and $docs)have the same information further information will be appreciated Getting same info with diferent queries - El Forum - 06-11-2008 [eluser]Derek Allard[/eluser] Can you take CodeIgniter out of the equation for a moment and just run those queries directly against the db? Also, can you echo out $this->db->last_query() after each to see what CI is actually running? Getting same info with diferent queries - El Forum - 06-11-2008 [eluser]kgill[/eluser] Sounds like the same old oracle issue that keeps popping up, see my response here: http://ellislab.com/forums/viewthread/74105/#368167 You can also search the forums, I think this issue has come up in about 4 other posts. - K Getting same info with diferent queries - El Forum - 06-11-2008 [eluser]tjmthome[/eluser] To your 1st. observation Derek, when i print out $this->db->last_query() after each query, it displays correctly. Also the file oci8_driver.php already has the change as noted kgill here I made queries by hand and there is no problem; the info displays correctly Code: <?php I want to point out that this is a existing application wich we're migrating, to CI thanks again for help supplied. |