Design a hotel reservation website backend. a special room only sells 5 rooms a day. how can I set the number of such rooms in the database to 5 at a certain time every day? Does MYSQL have this function? Write a piece of code to insert the roomNum field and update it every day... design a hotel reservation website backend. a special room only sells 5 rooms a day. how can I set the number of such rooms in the database to 5 at a certain time every day? Does MYSQL have this function? Or write a piece of code to insert the roomNum field to implement the function of updating five of them every day?
Reply content:
Design a hotel reservation website backend. a special room only sells 5 rooms a day. how can I set the number of such rooms in the database to 5 at a certain time every day? Does MYSQL have this function? Or write a piece of code to insert the roomNum field to implement the function of updating five of them every day?
Mysql adds an Event from 5.1.6 to meet your needs.
But we do not recommend that you do this. The first configuration is complicated, and the second maintenance is very troublesome.
Since the website background completely writes a scheduled task, you can reset the field on a daily basis.
The built-in qurtz in SpringFramework can easily execute scheduled tasks.
What are you saying you are using PHP? when I did not say it is okay.
Who said php would not work? Cron is easy to use. do not despiseThe best language in the world
:)
There should be a reservation record. you just need to query the number of special rooms that have been ordered in the record of the day.