Home › Forums › Quform PHP › Check if email exists in database on submission validator ?
Trying to get this validator to work ?
What am I missing ? Thanks
I just want one unique email in database ( user can not submit another if email exists ) ??
You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
Ok , I have working code here. It works perfect.
Do you see anything wrong with it ?
Right before the //build query code, I put this:
// email validation from josh
$emailCheck = mysql_query("SELECT email FROM table WHERE email = '" . mysql_real_escape_string($form->getValue('email')) . "'");
if (mysql_num_rows($emailCheck) > 0) { echo 'Email exists already. You can only enter once. Sorry.'; die(); }
// Build the query
It runs perfect and throws the error!
I was just double checking with you to see if it looked alright!
Thanks.