$this->db->select('*');
$this->db->from('order_items');
$this->db->join('orders', 'order_items.order_num = orders.order_num');
$query = $this->db->get();
SELECT id, GROUP_CONCAT(message SEPARATOR ';') from messages GROUP BY id;