How To Check If The Company Field On The Frontend Already Exists

I'm trying to check if company on the frontend already exist then show error message, it checks the email but i want it to also check if a company name on the front end already exists, this is what i have tried, any help is appreciated.

//check if the entered company name already exists in the database

if (!isset($user_data['company'])) {
$user_data['company'] = db_get_field("SELECT email FROM ?:users WHERE user_id = ?i", $user_id);
$is_exist = fn_is_user_exists($user_id, $user_data);
//show error message if true
if ($is_exist) {
fn_set_notification('E', __('error'), __('error_user_exists'), '', 'user_exist');
return false;

Do you mean vendor registration page?

Do you mean vendor registration page?

The user side of the company but i got it figured out, thanks