[eluser]CloakandPigeon[/eluser]
Hello, kind of new here and just wanted to post up an issue I am running into currently. I am attempting a join between an articles and users table so that I can pull the username column instead of printing out an ID number (it isn't very helpful to just have a number when trying to determine who the article belongs to).
I have the following code in my model:
Code:
$this->db->select('articles.*', 'users.*');
$this->db->from('articles');
$this->db->order_by('articleID', 'asc');
$this->db->join('users', 'users.id = articles.userID');
$query=$this->db->get()->result();
return $query;
All fields are available to me when I pass it to the view from the articles table, but none of them are available from the users table. I have attempted with the 'left' parameter added as well. Am I using the join command properly?
I am wanting to get a table with columns for everything in articles and added to that I want to be able to pull the username info from the users table.