5
In a simple form that saves the following data:
ID, IP, Date/Time, Name, Email, State/City.
When a person fills in the form, this data is recorded in the database. But if the same user fills in the form again, a new record will be registered, creating a duplication of information.
How can I control this scenario so that if the same person uses the form with the same data, instead of duplicating the record, increment only one counter ?
What type of database connection you are using?
PDO
,mysql
,mysqli
?– Zuul
Have you tried going to W3school, learning the basics of Sqli ? And you can also avoid this by using SQL using Unique.
IP => $_SERVER['REMOTE_ADDR'];
data => date();
hora = time();
// you can always create a function to write in Portuguese.– Edilson