CodeIgniter Forums
Using Jamie Rumbelow's MY Model - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Using Jamie Rumbelow's MY Model (/showthread.php?tid=57850)



Using Jamie Rumbelow's MY Model - El Forum - 04-17-2013

[eluser]xtremer360[/eluser]
I have a question I'm using Jamie Rumbelow's MY_Model as my model and I'm trying to figure out how I can add a field from a separate table.

Site Pages- id, page_name, page_slug, date_created, author_id, sort_order

I do a get all function run to get all the records of the site pages. It returns the array correctly however when it does it returns the value of the author_id which I need it to get the actual user's name from a user's table.

Users - id, username, first_name, last_name

So the author_id equals the id of the user table and it needs to select the first name and last name. I'm not sure how to pull this off with this MY_Model.

Has anyone else tried doing this before?



Using Jamie Rumbelow's MY Model - El Forum - 04-18-2013

[eluser]Aken[/eluser]
Relationships


Using Jamie Rumbelow's MY Model - El Forum - 04-18-2013

[eluser]xtremer360[/eluser]
I've read it many times but having a hard time understanding what I would need to do with my script.


Using Jamie Rumbelow's MY Model - El Forum - 04-21-2013

[eluser]xtremer360[/eluser]
I found this post and trying to apply the same logic.

http://stackoverflow.com/questions/7487485/codeigniter-model

And its still not pulling in the data from the users table.