Page 1 of 1

cms to display dates - looking for suggestions

Posted: Tue Apr 12, 2005 12:58 pm
by thurstan
sorry but i put this in the wrong section eariler - think it's more suited to this section, so moved:

i am trying to create a small cms that will allow the user to display the following information on a webpage:

COLUMN 1-----COLUMN 2
month1
out date-----return date
out date-----return date

month2
out date-----return date
out date-----return date

...and so on for many months. so the user will pick a month, an outward date and return date.

the way if see it, i can create a drop down list for the user to pick a month (which will be added to the database as 'month'), to pick out and return dates (added as 'outdate' and 'returndate'). i can see how to display this information on a page. but i can't see a way to for the user to do this many times without creating loads of tables / fields in the database (maybe this is the only way?)

i am at a loss as to how this can be achieved and relatively new to php. it would be really helpful if anybody has done something similar or could give me a hint as to how this could work.

many thanks

Posted: Tue Apr 12, 2005 1:05 pm
by Burrito
if I understand you correctly, you're concerned about having multiple entries into the db for return and out dates, if that's correct here's what I'd do:

create a table dedicated for those dates with four fields:
id -- autoincrement
userid -- int
outdate -- datetime
returndate -- datetime

then when they select a month, out date, and return date, you just enter a new record on that table with the appropriate information. You can then select by joining that table with your users' table to determine which dates they've "selected".

that shouldn't cause too much of a processing bottleneck as that table structure will be very small and should be able to retrieve data very quickly...you could even index some of those fields if you wish.