How do I prevent duplicate entrys to mySQL?
        Posted  
        
            by ggfan
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by ggfan
        
        
        
        Published on 2010-03-30T19:21:09Z
        Indexed on 
            2010/03/30
            19:23 UTC
        
        
        Read the original article
        Hit count: 541
        
On my site, I have a form that users fill out to become a member. They fill out name, bday, email, etc. Then when they click submit, the data gets into mySQL. But sometimes when a user clicks submit many times or refreshes the page, the data gets inputted to the database more than once. How can I prevent this? Is there a code I can use to only let one set of data get into the database?
This is also a problem in my comment section. I allow uses to put comments on people's profiles. But when they abuse the refresh button or submit button, I get like 10 of the same comments.
Thanks.
© Stack Overflow or respective owner