MY Model Joins |
[eluser]xtremer360[/eluser]
I am attempting to find out how to understand the use of Jamie Rumbelow's MY_Model in specific of how to implement this idea. I'm putting a game app together. There are many users and many characters. Each user can have many characters but only each character can be controlled by one user. I have a user's table that has a field called default_character. This is the foreign key that is represented by the id field of the character. In my code I am using the following function call to get the current logged in user. Code: $user_data = $this->user->get_by('username', $post_username); What I would like to do is when I do this and it adds in the integer value from the default_character field instead I would like for it to go get the name of that character. What would this look like? Code: tables Code: <?php Code: <?php I'm wondering if this is a database structure issue. Any more thoughts on this topic? Any help would be great. I'm still having some concerns on what I'm doing wrong. Anybody able to help me out? |
Welcome Guest, Not a member yet? Register Sign In |