[eluser]pickupman[/eluser]
Once you call the the query ->row() method, $query is not a result object. That means $query->num_rows() will be false. Use this instead.
Code:
$query = $this->db->get_where('clients', array('name' => $name))->row();
if ( count($query) > 0)
return $query->id;
return FALSE;
The else is not needed as there is only one other option to return which is FALSE.