![]() |
Need Help With Active Record Join Function - 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: Need Help With Active Record Join Function (/showthread.php?tid=43930) |
Need Help With Active Record Join Function - El Forum - 07-28-2011 [eluser]ShoeLace1291[/eluser] I'm trying to duplicate a query that I was given that will use a table of articles to select rows with similiar tags compared to the current article. I have a table called "tutorial_articles" that stores tutorials. Next, I have a relational table called "tutorial_tags" that store single keywords in each row. The tutorial_tags table has a column called tutorial_id that matches the keyword with the right article. This is the query I was given as a sample and I'm trying to duplicate it using the active record class functions. The code instead uses a photo table as the main table. Code: select t2.photo_id, This is my code: Code: $CI =& get_instance(); This is the syntax error I'm getting: Quote:Unknown column 'tag2._tutorial_id' in 'on clause' Need Help With Active Record Join Function - El Forum - 07-28-2011 [eluser]jmadsen[/eluser] read your error message. you have an underscore in your field name: Unknown column ‘tag2._tutorial_id’ in ‘on clause’ |