06-21-2011, 04:00 AM
[eluser]Wonder Woman[/eluser]
Hello,
I want to concat two fields together but I am having trouble with the query containing joins...
Any idea how I can fix this? Thanks
Hello,
I want to concat two fields together but I am having trouble with the query containing joins...
Code:
$this->db->select('*, news.id as news_id, news.created as created_on, CONCAT(users.firstname, users.surname) as article_author, CONCAT(modified_user.firstname, modified_user.surname) as modified_author');
$this->db->join('users', 'users.id = news.author', 'left');
$this->db->join('users modified_user', 'modified_user.id = news.modified_by', 'left');
Any idea how I can fix this? Thanks