Jump to content

db schema advice?


Mr Chris

Recommended Posts

Hi All,

I'm trying to figure out the best way to design my content management system for a section that displays 'unavailable dates' for a specific property and would appreciate all advice.


Now I have a DB of properties (lets say 800 properties)

[b]properties_for_rent[/b]

prop_id  | Name          | price
----------------------------------------
1        | Wrayfish      | £200
2        | Costa del la  | £400
3        | Terrace way    | £600
4        | Mid of Terrace | £800
--> to 800|                |

I then want to say which dates throughout the year each property was unavaliable (because it's been booked already)

Now the best way I thought of doing this was to create a [b]booked_dates[/b] table with the prop_id from the [b]properties_for_rent[/b] tabe as a FK to link the two tables together:


[b]booked_dates[/b]

booking_id| arrive        | depart    | prop_id* |
----------------------------------------------------
1        | 2006-12-28    | 2006-12-29| 1        |
2        | 2006-12-28    | 2006-12-29| 2        |
3        | 2007-01-25    | 2007-01-27| 1        |
4        | 2006-07-28    | 2007-03-29| 4        |
5        | 2006-11-28    | 2006-11-29| 1        |

However - these are really the two questions I have:

1) would this schema work well in the Content management system?  I'd probably have thousands of booking date records in my CMS (although maybe I can delete all records in the booked dates table when a property is deleted?

[b]And the main problem[/b]
2) In the content management system for adding the booked dates how could I do this?

For each property throughout the year there will be possibly hundreds of booked dates.

Now I thought of adding a page like this for each property:

http://www.slougheaz.org/directory/sp/select_dates.php

But the bookings made may be for many more booked dates than this, so is there a better way of specifying the booked dates rather than having a large list of booked dates textboxes to fill in? 

Can anyone think of a better way of doing this?

Thanks

Chris


Link to comment
https://forums.phpfreaks.com/topic/28514-db-schema-advice/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.