Portal Home > Knowledgebase > Articles Database > php/mysql seating chart


php/mysql seating chart




Posted by cnapsys, 09-08-2008, 07:50 AM
hey guys, I'm working on a rather complex system and I cant figure out the best approach: This is for an online ticket selling system. I'm currently working on the inventory module. I have several seating charts from several venues. The seating charts break down into: 1) Zone 2) Rows in current zone 3) Assigned seats on each row E.g. Zone A has 10 rows. Each row has a specific number of seats. R1: 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 R2: 1,2,3,4,5,6,7,8,9,10,11,12,13,14 . . . R10: 1,2,3,4,5,6,7,8,9,10,11,12 Here's what I'm thinking: Option 1. Have a table for each zone based on the # of rows and for each row build an array with the seats. Option 2. Have a preset table with a larger number of rows and seats and mark them with 1 for valid 0 for invalid Let me know if there is a better approach or if you have any suggestion on how this should be done. I'm trying to make it as simple as possible for the vendors/organizers that will have an event at one of the venues that I have the seating chart for. However, there will be events at other venues that I will not have the seating chart and I'm trying to figure out a solution that will work for those as well. Any tips/suggestions would be greatly appreciated c

Posted by MikeDVB, 09-08-2008, 09:53 AM
I think I would just allow the venue to create their own seating charts with some basic instructions. Give them directions that they will need to create a new zone for separate seating areas (such as a balcony) and then suggest a maximum amount of rows per zone as well. This way if they want to use your script and you've not made a seating chart at least they will be able to generate one.

Posted by Sheps, 09-08-2008, 10:14 AM
Best way to do your table: Primary Key: rowid.seatid rowid int unsigned seatid int unsigned pricing, etc after this point dump into a array in the form of: $seatingchat[rowid][columnid] = array(other values) For printing it out on a webpage. Dump it into a loop, determine the larges row, and generate teh table based on the largest row. Doing it in this manner makes it scalable for any size venue.

Posted by cnapsys, 09-09-2008, 01:01 AM
Thanks guys for your quick replies. I was thinking of something similar Table would be: zone - row - seat A-------12----5 A-------12----6 or zone - row - seat A-------12----{1,2,3,4,5...} A-------13----{1,2,3...} What I'm trying to figure out is which method would be faster/easier to process. On the event page would be a lot of features like "reserve ticket" for a 10 min session, which on heavy load traffic can cause some problems with loop queries and playing with array elements by having to remove them for a particular period of time or put them back in case the sale does not go through within 10 min. I wanted to see if there's a better way of doing this or if anyone has any ideas/suggestions.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
vpseasy.com. down (Views: 675)
FDCServers (Views: 660)

Language: