I want to check an input email address in a MySQL table to see if a form input of an email address exists or not. I want to include in "exists" items either in the $_POST['var'] or the existing MySQL table that have either leading or trailing spaces.
Does this do the trick?
$qry = "SELECT * from users where TRIM(email) = '" . trim($_POST['email']) . "'";
If I get a match (meaning the email is already there with or without leading or trailing spaces, the logic will go path A, otherwise, path B.
Will this do what I want?
Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>