DataMapper - How to get NOT related - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: DataMapper - How to get NOT related (/showthread.php?tid=45713) |
DataMapper - How to get NOT related - El Forum - 10-02-2011 [eluser]Genki1[/eluser] How do I get all the Books which are not related to a specific User. The relationship is Many to Many. The following query works, but is it the best way to accomplish the query? Code: $u = new User(1); // get user id #1 I derived the above from these two queries which get close to the desired result but are not exactly what I want: Code: // finds Books related to Users other than user #1 (but excludes Books which have Code: // finds Books not related to any User at all (but excludes Books which have |