View Full Version : Golf Booking System Help

03-23-2010, 11:16 AM

I am developing a website for my local golf club. I am trying to create a few pages where members can book tee times for competitions held at the club.

Im thinking the best way to approach this is to set up a database a table for the competition which will have many tee times.

However the problem comes where there are up to 4 players can have a specific time.

I think if i have the following it could work:

Competition table

Competition ID
Competition Name
Competition Date
Entry Fee
Competition Format
Tee Time ID

Tee Time Table

Tee Time ID
Tee Time
Player ID

Also is there a way to make the tee time tale the same format and only add a value for the player ID as the tee times available will not vary too much from comp to comp.

ANy help on this or a booking system will be much appreciated. Also i will be working this in sql and php.

Thanks in advance.

03-23-2010, 11:50 AM
you would handle the tee off time as a single booking. You can assign as many players to the tee off time slot

I think i need a little more detail and a scenario in order to fully understand your requirements

03-23-2010, 11:56 AM
So you mean instead of different slots, just have one tee time and have player, 1 player 2, player 3, player, 4???

Basically each sunday the golf club has a competition, the format and rules of the competition can vary. At the moment people have to travel to the golf club and insert them name into a free slot on a sheet of paper. I am trying to create a system so people can enter the competion in the same way (choosing their desired time of play) but via the internet instead of travelling to the golf club to do this.

The sheet names are inserted onto has the following layout, 5 columns, 1 for the time and 4 seperate slots for each players name. I am tryig to replicate this the best i can so players are familiar with the format and dont get too confused.

03-23-2010, 12:19 PM

Id create your tee off time slots first. Don't bother with how many players are playing first. Concentrate on the tee off time functionality for the first phase. This is a simple calendar implementation. Just allocate each block booking enough time so four players have time to tee off

once your system is making slot bookings you can then extend the functionality to register players against booked slots


book a slot [time, date] -> Add players from member list

You could add player profiles which could record results, wins, handicaps etc

03-23-2010, 12:28 PM

Player profiles was my intention later on.

I could do a simple booking for one player at one time slot thats not a problem. But i really need to add up to four players to one time slot. The only problem i have then is that the duplication in the table.

A way around this would be maybe have a slot table which would be a secondary to the time table, each ime could have 4 slots the player info could then be entered there???

another possibility could be to have the tee time ID as say the time and slot therefore when i come to refrence and display the tee tiems i could refrence that??

Just trying to get the best possible solution. I can make a simple booking system no problem im just trying to get the best way to do this solution. Thanks for the help and please keep it coming.

03-23-2010, 01:18 PM
Below is an eample of the type of form names are submitted onto. Im looking for the best database layout to store the info and generate the display of the info onto a website. Allowing people to fill empty slots and see who else appears in certain time slots.

Check the attachment!!

03-23-2010, 02:35 PM
I would have a booking time table and players table

The booking time table would have an auto incrementing ID which you would use in the player table against users allocated to that time slot

03-23-2010, 03:09 PM
If i set the tables up as follows will this be suitable for storing such info??

CREATE TABLE Competition_Table
(Competition_ID integer,
Competition_Name char(50),
Competition_Date date,
Entry_Fee char(50),
Competition_Format char(25),

(Tee_Time_ID integer,
Tee_Time char(50),
Competition_ID integer,
Foreign Key (Competition_ID) references COMPETITION_TABLE(Competition_ID));

(Slot_ID integer,
Slot char(1),
Member_ID integer,
Tee_Time_ID integer,
Foreign Key (Tee_Time_ID) references TEE_TIME_TABLE(Tee_Time_ID)
Foreign Key (Member_ID) references MEMBER_TABLE(Member_ID));

The only problem with this method is there will be many 7:00, 7:20's etc in the tee_time table and Many A's, B's, C's, D's in the slots table which when i was taught database design this was bad, the idea of having links etc is to reduce/remove the requirement of repetition.

Any help is much appreciated.

03-24-2010, 01:11 AM
would it not be an answer for the tee time table to have slot1 slot2 slot 3 and slot 4
then with each slot time one record use update for the records with empty slots?

03-24-2010, 12:07 PM
I suppose that would make more sense to have slot 1, slot 2, slot 3, slot 4 in the tee time table.

however i would only be adding the player/member ids into this field and getting the details required from the members/players table, is this still a viable option??

Also there would be still loads of 7:00, 7:20's and so on in the tee time table is this practice suitable??

03-24-2010, 01:33 PM
Id have the following table structure

Comp Table

Tee Off Table

User Table


Comp Table -> Competition Details

User Table -> Teams (grouped with team ID)

Tee off table -> Tee off times (one 'tee off' time allocated per row. 'Team ID' reference team allocated to that time)

03-24-2010, 01:42 PM
thing is with having members table with teams in it you will not have the same teams playing together each week. For whatever reason people play with different people each week and at different times. I agree the majority will play with the same people each week however a lot of people will not, therefore having teams is not suitable.

Please remember golf is a largely individual sportnot a team sport so one individual can have random requirements as to slot and time.

I appreciate all suggestions thank you!

03-24-2010, 02:53 PM
Yes which is why you would set your team up first creating a team id to be used in your Tee Off table

03-24-2010, 02:57 PM
I am not sure what you are getting at.

Golf contains no teams or in the scenraio i am trying to create golf has no team element.

please explain your solution a little more?

As far as i can see if i was to create a team table that would imply that a specific group would play together all the time!! However this is not the case, if you are playing with one set group one week you may be playing with totally different people in the next weeks competition.

03-24-2010, 03:00 PM
or are you implying the same solution as i have already suggested??

By having the slots table this would act in the same way as i think you are trying to suggest. Where if i have slot1, slot2, slot3, slot4 in a seperate table this would be the same as having player1, player2, player3, player4 in the team table.

03-24-2010, 03:05 PM
i think i may have just clicked. If i have the tee time table and have the tee times as the different fields i can insert the teamid or group id into each field.

In the group/team table i can then have group id, player1, player2, player3, player4 and insert the player id's into each field.

03-24-2010, 03:38 PM
nope thats not it, that doesnt work having a table full of times refrencing to group ids as there is no way to link the 2

03-24-2010, 06:26 PM
My thoughts were along these lines ...

A user creates a team. It can contain between 1-4 players. They can name their team from here and a team ID is created. The team only exists for one competition.
They can then select a Competition.
They now have a team ID and Competition ID which they can allocate to a Tee Off Time.

03-24-2010, 06:31 PM
The problem with that is that individuals will not necessarily know who they are playing with that specific week.

The idea is each individual will selct one slot and one slot only as a lot of the competitions are individual events. People may play with the same people each week but it is very unlikely that they will.

i dont want other people adding other people either as some will not turn up and claim so and so added them into the comp when they didnt want to.

I hope this all makes sense!

03-24-2010, 06:46 PM
What about this...

Players can join already created teams or create their own team which contains just them self but can not add others to it.