[eluser]JamieBarton[/eluser]
Fixed it up a bit, to
Code:
$query = $this->db->query("(SELECT id as id, start_time as date, title as name, 'event' as type FROM events WHERE family_id = $family_id) UNION (SELECT user_id as id, birth_date as date, first_name as name, 'birthday' as type FROM users WHERE family_id = $family_id) ORDER BY date LIMIT $limit");
return $query->result();
However I don't know where to put the WHERE date is greater than today and less than 1 week from now. Can anyone assist with that?
Also, what if I want to grab the users last_name too? How can I add that into the second query without getting an error of having unequal columns?