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've just answered your own question :) You can do something like this:
$query = $this->db->get(); $ret = $query->row(); return $ret->campaign_id;
You can read more about it here: http://www.codeigniter.com/user_guide/database/results.html