Jump to content

mysql database layout


rempires

Recommended Posts

hmm i wasn't sure if i was supposed to post this here or under mysql help, but here seemed more appropriate

 

I need some help figuring out a design for my database.

 

I have a site were people can make a schedule based of events/locations we have on our site.  They choose date (02-06-08), a time like 2pm-6pm, then a place, like This Hotel.  From there it builds a schedule (obviously, they add more than one place/time, in fact usually it will span over a week or more time frame).  They can then save this schedule so that they can access it from there accounts at any time, my problem is trying to figure out the database layout to use, I've thought out all the javascript/php but the layout for the database is stumping me.

 

i have a table called schedules, and so far it have "scheduleId, scheduleName, allowOtehrsToView, keyWords"<-the keywords,allowOtehrsToView  is there only because other users may search for peoples schedule IF that user allows it, this way people can look at others and get an idea of what's "hot".

 

Now I'm trying to figure out were to go form here.  All the places/events they can choose are stored in 2 more tables called events and locations. When they view their schedules it will obviously have to load all this data so i was thinking maybe a textField like

 

02-06-08:2pm-6pm:E1 <- and then using php to split all that apart and saying okay on 02-06-08 at 2-6pm they will be (then select from the events table the event with id 1). this would work but it doesn't seem very efficent on php side, or easy to maintain.

 

My other idea was to split schedules into 2 tables 1 would contain

 

schedule  table

"scheduleId, scheduleName, allowOtehrsToView, keyWords"   

 

and the 2nd one would maintain something like

schedule 2 table

"Id, scheduleMasterId, timeStart, timeEnd,Date,eventOrLocation, EventLocationId".

 

this would work by first loading the schedule table and getting the sceduleID based on the name when they click on their schedule. Know we would load from schedule2 table all of the data were scheduleMasterId=the sceduleID from the first schedule table.  We could then use all that data to get the data from events/locations table.

 

I think the second one would be easier to maintain,work with. But less efficient on the mysql side? any ideas on a better way, any opinions on improvements my way or anything at all would be appriceiated

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.