468,249 Members | 1,489 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,249 developers. It's quick & easy.

Ticket Booking System

I am prototyping a ticket booking system and just wanted to ask a few
questions.

1 - What is the standard way of temporarily reserving a number of
tickets throughout the purchasing process (to stop other people
reserving those seats or whatever).

2 - What do you do to release these 'seats' if someone closes their
browser? Is it just a cron job set for every 20 mins?

I am sure I have seen a solution to this before but can't find it now.

Regards,

Rick

Feb 13 '06 #1
1 5337
thehuby wrote:
I am prototyping a ticket booking system and just wanted to ask a few
questions.

1 - What is the standard way of temporarily reserving a number of
tickets throughout the purchasing process (to stop other people
reserving those seats or whatever).

2 - What do you do to release these 'seats' if someone closes their
browser? Is it just a cron job set for every 20 mins?

I am sure I have seen a solution to this before but can't find it now.

Regards,

Rick


Hopefully you are using a database to store the information...
add a columns called
rsvd_date and purchased_date,
rsvd_by, purcased_by in your "SEATS" table when someone "reserves" them update
those seats with the time they were reserved and the username that reserved
them. That way you can go back to their "reservation" should they get
disconnected before they purchase them.

Then run a job - say - every 3 hours and if there is a reserved date and no
purchased date and the reservation is > 2 hrs old (or however long you want them
to be able reserve the seats) then update the seat and set the reserved
date/username to NULL.

You MUST store this stuff in the db as your browser and/or server-side PHP
scripts run as autonomous transactions.

What that also means is that if 2 people try to reserve the same seat at the
same time, you must make sure you trap for that occurrance. (only update the
record if the reserve_date AND purchase_date is null... rows update something > 0)
--
Michael Austin.
DBA Consultant -
Oracle Rdb/Oracle RDBMS/MySQL and most any other ANSI-standard SQL-based db
Donations welcomed. Http://www.firstdbasource.com/donations.html
:)
Feb 13 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Dave Robinson | last post: by
2 posts views Thread by PaulD | last post: by
20 posts views Thread by bredal Jensen | last post: by
reply views Thread by Sean Patterson | last post: by
reply views Thread by thegame21 | last post: by
3 posts views Thread by =?Utf-8?B?cGF0cmlja2RyZA==?= | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by kermitthefrogpy | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.