![]() |
Strange Issue Duplicated DB 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: Strange Issue Duplicated DB Queries (/showthread.php?tid=47106) |
Strange Issue Duplicated DB Queries - El Forum - 11-26-2011 [eluser]rockoo[/eluser] Hi, I need to start caching my DB queries due to high traffic volume. One of the application is using CI 1.7 as is being ported to 2.1 (not sure if this might be a problem). I've used two different cache libraries Memcached and File cache however both produce this strange result of duplicate query throwing Not unique/alias DB error. This is my original query Code: $q = $this->db resulting in this error Quote:<h1>A Database Error Occurred</h1> And the outputed query is this Code: <p>SELECT `a`.`id`, `a`.`title` album, `e`.`id` eventID, UNIX_TIMESTAMP(a.date) date, `c`.`name` client, `c1`.`name` venue, `cy`.`category`, `a`.`id`, `a`.`title` album, `e`.`id` eventID, UNIX_TIMESTAMP(a.date) date, `c`.`name` client, `c1`.`name` venue, `cy`.`category` I have no idea why this happens... And its only happening when trying to use any caching library. The queries work with no problem otherwise... Can anybody please help me out Thank you Strange Issue Duplicated DB Queries - El Forum - 02-22-2012 [eluser]ludo31[/eluser] I have also the same problem Code: $this->db->select('id'); and I change $query = $this->db->get("chaussure"); by $query = $this->db->get(); and it works Strange Issue Duplicated DB Queries - El Forum - 02-23-2012 [eluser]smilie[/eluser] ->from('album as a') is correct syntax, try that first; Cheers, Smilie |