I am making a system where a user can get a reward code, but only every 24 hours. I want to insert a record into a MySQL database, that deletes itself 24 hours after being added. This way I can use mysql_num_rows to see if the row is there.
How would I make a mysql row that deletes itself after 24 hours? Or is there an alternative to this, where I can check if specific information has already been used in the past 24 hours?
How about adding an
expirationcolumn to the table, and checking that to see if the code is still valid? Additionally, add aredeemedcolumn, where you can mark whether a code has been used.