Using Active Record on object split across two tables in codeigniter

zheng220yi

New Member
I have a controller that is represented in the database by two tables, \[code\]pages\[/code\] and \[code\]page_contents\[/code\]. \[code\]pages\[/code\] contains the author information, unique id for the the page, and creation timestamp. \[code\]page_contents\[/code\] contains the page uid as a FK, the contents of the page, last editor, and edit timestamp.When a page it requested I need to pull the original author and creation timestamp, the contents of the most recent revision of the page contents.How would I do this using active record methods? Or will I have to use $this->db->query(() and a handcrafted SQL statement?
 
Back
Top