Getting Single Result From Codeigniter


November 12, 2018 2 minutes codeigniter , database query

public function single_result($id)
{
    $this->db->select( '*' );
    $this->db->where( 'id',  $id);
    $q = $this->db->get( 'attachments' );
    $first = $q->row();
    return $first;
}

See Also