## php – How to set variable to specific field when querying

Question

I am trying to validate an input box against a field in a database. My question is, how does one check a single input equal to any field in a column? I am able to connect to my query, but am unable to perform the validation. Am I missing something?

Here is my code:

add_action('woocommerce_checkout_process', 'username_auth');

global $wpdb; // INPUT FIELD$username = $_POST['custom_field_username'];$user_login_sql = $wpdb->get_results("SELECT username, FROM registration_info WHERE username"); if(isset($username) && $username !==$user_login_sql) {