public function check_username(Validate $array, $field)
{
$exists = (bool) DB::select(array('COUNT("*")', 'total_count'))->from('users')->where('username', '=', $array[$field])->execute()->get('total_count');
if (!$exists) {
$array->error($field, 'not_found', array($array[$field]));
}
}