FireFox! The PHP Forum Loans and Credit
Panama Web Design for Hire Free Insurance Quotes!
Web Hosting Advertise Here $10 a Month Designer Children
Never Pay Taxes Again HGH Domain name registration
Web Hosting and Dedicated Servers Insurance Affordable web-hosting


HomeWatched TopicsRegisterSearchDirectory
FAQMemberlistUsergroupsLog inStoresItemsBank
Google

Reply to topic Page 1 of 1
username validation
Message  

Reply with quote
Post username validation 
My job is offering an online drawing.  I made a form for the registration that connects to mysql.  The thing is people can only register once.  How can I search the database to find an email and if that email is already entered, tell the person to register on the next drawing?  Any help would be great!

View user's profile Send private message

Reply with quote
Post  
Here is what I came up with.

if($email)
             {
           $query = "SELECT * FROM DrawingOne WHERE email='$email'";
               $result = @mysql_query ($query);
            if (mysql_num_rows($result)==0)
                     {
                   $sqlquery = "INSERT INTO DrawingOne
                       VALUES ('$id','$name', '$co_name','$email','$address','$city','$state','$zip','$bus_phone','$cell_phone','$home_phone' )";
                  $results = mysql_query($sqlquery);
                  mysql_close();
                      echo "Thank you.";
                        exit();
                     }
           }
           else
                {
           echo'<p><font color = "red" size = "+1">Sorry, but that email is already entered into our drawing.  Please enter in our drawing next month.</font></p>';  
            }              

I does not work and I was wondering what I did wrong.

View user's profile Send private message
Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
  



Google

FireFox! The PHP Forum Loans and Credit
Panama Web Design for Hire Free Insurance Quotes!
Web Hosting Advertise Here $10 a Month Designer Children
Never Pay Taxes Again HGH Domain name registration
Web Hosting and Dedicated Servers Insurance Affordable web-hosting


Web Design by PlatinumShore.com & Web Hosting by TradeWebHosting.com