Remove Mysql row after specified time

前端 未结 5 1729
忘了有多久
忘了有多久 2020-12-21 06:46

I\'m trying to create a computer reservation system, where user chooses a computer and select the time how long he will be using this PC. In that time other persons can\'t r

5条回答
  •  情歌与酒
    2020-12-21 07:01

    The common way to handle this is to store an expires_at timestamp on the reservation row. Then your query to find any "open" reservations would have WHERE 'expires_at' < NOW() or something similar.

提交回复
热议问题