rempires Posted January 2, 2008 Share Posted January 2, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/84069-mysql-database-layout/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.