pre-determined array?

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
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

pre-determined array?

Post by aceconcepts »

Hi,

I guess this is an opinionated post...

I would like to display a list of time slots (0800 to 2000) a lot like a diary may contain.

What would be the best way of going about this?

My initial thoughts were:
1. Store the values in a table and then loop values in order to display them
2. Create a pre-determined array and simply loop and display values

For each time slot displayed I would like to display a corresponding "body" i.e. like an appointment slot.

Any comments?
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Post by Zoxive »

Use Timestamps in the Database.

Then its just as easy as using some of Mysql's Date and Time Functions.
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Post by aceconcepts »

Thats kinda what I was thinking. Thanks for the post Zoxive :D
Post Reply