Remove Mysql row after specified time

前端 未结 5 1727
忘了有多久
忘了有多久 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:11

    Normally I would do it this way:

    • when storing a reservation, store date_from and date_to both of datatype DATETIME
    • when checking if there is a computer free check for all computers and filter with WHERE '{$my_date}' >= date_to AND '{$my_date}' <= date_from - by this You should be able to get all the PCs that are not reserved within a certain time...

提交回复
热议问题