I am trying to learn how to do a simple Select query using $wpdb-prepare.
I am checking wether an email submitted by the user is already available in the database.
There has to be something wrong with the syntax because the string placeholder is undefined, according to PHPstorm.
$mail = $_POST['email']; $table = $wpdb->prefix . 'members'; $sql = $wpdb->prepare( "SELECT * FROM $table WHERE email = $s", $mail); $result = $sql->get_results($sql);
What would the correct syntax be?