search

Home  >  Q&A  >  body text

php - Operation problems after the registration verification email expires

Regarding the issue of registration verification email, my idea is as follows:

  1. Add the status field to the database to record the email verification status. The default is inactive

  2. Send a verification email address to the user's email address, and the user can activate the email address only after clicking it

  3. If the user is not activated within a certain period of time, the user data will be deleted

My confusion lies in the third article (of course there are other ambiguities that can also be pointed out)

  1. Do you want to violently delete it after it has been inactive for a period of time? Will that be okay? (Is the way of doing this inappropriate?)

  2. [Key]How to delete data

How to delete data [Question]

  1. My idea is to add a user creation time, and then delete the data based on the user creation time and activation status.
    But I don’t know what the specific idea is.

  2. Also, I don’t know whether to use a programming language to write logical deletions or use a MySQL database to write logical automatic deletions.

  3. I know a lot about NoSQL, but I am curious whether this function can be implemented using NoSQL such as redis and memcache. Which one is better than mysql?

大家讲道理大家讲道理2708 days ago979

reply all(3)I'll reply

  • 三叔

    三叔2017-06-30 09:54:35

    The email verification field should be added to the user table. If you want to keep application records, you can create a new table

    reply
    0
  • 给我你的怀抱

    给我你的怀抱2017-06-30 09:54:35

    1. You can create a field for email activation or not. There is no need to delete it if it is not activated

    2. You can use php to write the deletion logic, and then start a scheduled task to execute it. Go and operate mysql regularly.

    3. You will eventually need to implement mysql to modify the data. In fact, it doesn’t matter which one you use!

    4. I don’t recommend deleting records directly. But it can be deleted

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-06-30 09:54:35

    With redis, you can set the expiration time, so you don’t need to maintain the deletion operation yourself

    reply
    0
  • Cancelreply