Hello,
I'm trying to show the name of a channel associated with an event through an FK, but I'm not able to show it.
Model:
public function get_events() {
$this->db->get('events');
$this->db->join('channels', 'events.channel_id = channels.id');
$this->db->join('colors', 'channels.color_id = colors.id');
return $query = $this->db->get('events')->result();}
View:
foreach($events as $event){
echo '<tr class="odd gradeX">';
echo "<td>".$event->start." - ".$event->end."</td>";
echo '<td class="center">'.$event->channels->name.'</td>';
echo '<td class="center">'.$event->status_id.'</td>';
echo "</tr>";}
Any suggestions?