I need help. I need to get a user ID or email (email is can do but ID is better) based on their phone number, outside of WordPress. I already have their phone number in a variable and billing_phone is custom metadata in the wp_users table. This is what I am using to load wp
`$parse_uri = explode( 'wp-content', $_SERVER['SCRIPT_FILENAME'] ); require_once( $parse_uri . 'wp-load.php' );`
and how I am fetching the email.
`$email = $wpdb->get_var("SELECT user_email FROM wp_users WHERE billing_phone = $phone_number ");`
Thank you all in advance. Any help is appreciated.