I have a MySQL Table that has a column that will AUTO_INCREMENT
, another to store user-submitted data, and another column that defaults to CURRENT_TIMESTAMP
.
My INSERT
query is:
$query = $db->prepare("INSERT IGNORE INTO `UserData` (`user_data`) VALUES(?)");
$query->bind_param('s', $commentdata);
$query->execute();
However it is still inserting the duplicate values (if a user clicks submit multiple times). What is the best way to prevent this?