
Sam Z. answered 08/27/20
Full Time Data Analyst at Amazon
So this is can be possible at either the PHP or SQL level, but I'll address doing this with SQL.
You'll want to use the modulus operator to rotate through the bungalows. You might need to tweak the following slightly due to the specific needs of your data, but it should be fairly close.
I'm assuming the ID field is numeric and am combining that with the mod operator and the current day of the month to cycle through the bungalows. The "gotcha" here is that row numbers start at 1 and mod functions can return 0 to "row numbers" - 1.
Here's an example: