At the moment if I am doing a query on the database that should only return one row, using:
...query stuff... $query = $this->db->get(); $ret = $query-
You can do like this
$q = $this->db->get()->row(); return $q->campaign_id;
Documentation : http://www.codeigniter.com/user_guide/database/results.html