[eluser]lookatthosemoose[/eluser]
Edit: I just realized the function below is a different one than referenced above, but same concept.
I'm using the active record class/methodology. So Im endeavoring to keep all the methods in this fashion:
Code:
function get_alias($id,$return_value=FALSE){
$query = $this->db->get_where('addresses',array('alias_id' => $id));
if($return_value){
$row = $query->first_row();
return ($query->num_rows() > 0) ? $row->alias : NULL;
}
return $query->$query->result();
}
I've added an optional parameter to dictate whether to return the object, or the value. Thus, best of both worlds.