473,569 Members | 2,683 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Selecting consecutive 'seats' in a seating chart

Greetings,

I'm sure there's an answer out there to this question. But I've been
looking for about 2 days and haven't found it yet. Maybe I'm just not
asking the right question.

I need to get X number of "unsold" seats out of a seating table. Order
them by the seat_number. (Seat #1 = closest to the stage)

For example, someome might buy the first 2 seats. Then the next
request is for 4 seats. I need to return seats 3, 4, 5, 6. But if, 3,
4, 5, 6 aren't available together, I need to return the next grouping
of 4 unsold seats. If it helps, here is my seating table:

CREATE TABLE `tt_seats` (
`building_id` int(8) default NULL,
`row_num` int(8) default NULL,
`seat_num` int(8) default NULL,
`seat_status` int(1) default NULL
) TYPE=MyISAM;

seat_status of 0 is unsold or "open". I hope that makes sense. I'm no
MySQL guru, yet... :)

Thanks for your help!
Kilroy
Jul 19 '05 #1
0 1831

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
3016
by: Adam | last post by:
Hi, I am trying to mark consective numbers in a data set and get a count as to how many consecutive numbers exist in the a given line of data. Here is an example line: 3, 5, 7, 9, 10, 13, 14 The relevant part of the script which currently checks for a
1
12498
by: Brian Shade | last post by:
Hi all. I am having a bit of a problem with my Perl script and the creation of a chart. I can create the chart and create a new SeriesCollection. I then specify the XValues and the Values parameter of the first SeriesCollection object. I add another SeriesCollection, but I am only able to set the XValues and I get the following error when I...
8
5684
by: Prabhakar | last post by:
Friends, I have been migrating ASP applications from IIS4.0/NT4.0 to IIS5.0/W2K. All the applications working perfectly except one. This particular application will make use of asp chart object. Sub BuildGraph(rate(), name,color,chartHight,chartWidth)
4
1599
by: remote89 | last post by:
Hi experts, I have been trying to limit the table rows in the following situation, any suggestions will be appreciated. we have table called tempTb has columns id, c_id, c_name, rating, date columns. id is an identity column. date is a datetime column, the rest are varchar datatype. Here is the table structure with sample data,
22
6750
by: PeteCresswell | last post by:
I've been to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mschrt/html/vbobjtitleobject.asp, but still don't have a clue. For example, I've got a chart object namde 'grphStats' in a form named frmChart. ?Forms!frmChart!grphStats.Name returns "grphStats" as expected, but I can't get any further.
3
2067
by: =?Utf-8?B?cGF0cmlja2RyZA==?= | last post by:
Hi everyone! I'm writing a booking system website, which needs a seat selection algorithm, my question is, if a user clicks on a seat (temporarily booking that one), how will the other users navigating on the same row of seats know that the previous user has already booked a specific seat? Perhaps a messaging system?
2
1691
by: ishakarthika | last post by:
i have a .txt file which contains line of string like the below format |111|34 sdddd| ppppp| A/C| 32| sadfd| |4324|23 mmm| yyyyy| A/C|32| fdfffdfd| the sixth column is the no of seats column where when i check the status of that particulat bus no 4324 it is displaying that the "seat is not available" and "available seats...
8
12932
by: gigonomics | last post by:
Hi all, I hope someone can help me out. I need to return the best available seats subject to the constraint that the seats are side by side (or return X consecutive records from a table column where the values are integers). I can do this programmatically (using code and stored procedures), but it's not a neat solution and there are also...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8122
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7673
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7970
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.