PHP Calender + SQL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Jza
Forum Newbie
Posts: 17
Joined: Sat Sep 23, 2006 10:10 am

PHP Calender + SQL

Post by Jza »

Let me give you guys a brief description of what I'm working on.

- 11 houses that are to be rent out between the remainder of 2007, until 2025.
- Users must be able to load up a website, view a calender and see when the houses are availible to be rented out.

For example, user loads the webpage, selects the house he is interested in, loads up the appropriate month and year, and can see if the house is availible for rent.

This must work of SQL, I can't seem to think of any other options but to do the following:
- One table per house per year, this would lead up to more then 150 tables, I don't think this is very acceptable.

Any idea is helpfull.
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Post by aaronhall »

What's the problem with making one table, and storing each house as a row?
Jza
Forum Newbie
Posts: 17
Joined: Sat Sep 23, 2006 10:10 am

Post by Jza »

I knew I wasn't thinking right.

So what you're saying is, 365 fields, 11 rows? x 15?

Or how about, 1 table and it just adds to it

House | Date
1 | feb1
2 | march6
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Post by aaronhall »

How many properties will each house have?
Post Reply