[eluser]valarkin[/eluser]
I think you are looking for something along these lines...
Code:
if ($this->uri->segment(3) && $this->db->field_exists($this->uri->segment(3), 'table_name')){
$sort=$this->uri->segment(3);
}
else
{
$sort="last_name";
}
I had it short hand, but it was way to wide for the forums
What you were looking for this:
$this->db->field_exists('field_name', 'table_name');