Check if email exists in database on submission validator ?

Home Forums Quform PHP Check if email exists in database on submission validator ?

This topic is: resolved
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #4615
    eberswine
    Participant

    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 ) ??

    #4630
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #4644
    eberswine
    Participant

    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

    #4654
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #4657
    eberswine
    Participant

    It runs perfect and throws the error!

    I was just double checking with you to see if it looked alright!

    Thanks.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2019 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy