Reply to Re: Ticket Booking System

Your name:

Reply:


Posted by Michael Austin on 02/13/06 19:40

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
:)

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация