tsoltysiak Posted February 5, 2010 Share Posted February 5, 2010 Hey, I'm having a bit of trouble figuring out how to make my database work for displaying a lot of information in an easy to see way. I'm not sure is this the right forum to be posting in, but seems like it's the closest one. Anyway, here's the issue: Background: It's a website with airline information for what size luggage they are allowed to have as carryon and checked luggage, for (eventually) every airline (currently only has about 15, as I just put it up recently, and haven't had time to set it up for every airline). I'm using a mysql database to store the information, and retrieving through php to display the appropriate information for appropriate airline. Most airlines have pretty simple regulations (eg. 2 bags for coach, 3 for business class), but some (such as United) have different size restrictions, weight restrictions, and # of bags restrictions, depending on destination and ticket class, so it's a lot of different combinations to put up (and making it harder to find the right information in the table on the site). Question: How do I retrieve the information for the airlines with a lot of data to display it in an easier way(in the United example, to have a table header row between "US/Canada" regulations and "North America/Europe" regulations? I know I could simply do it for every airline, split by destination, but different airlines have different regions for which they have the regulations, and for some there would only be 1 entry for each region, or 0 entries, so wouldn't look good to have a separate header for every row in a table. Here is the United Airlines page, so you can take a look to see what I mean by having the long table: http://www.airline-luggage-regulations.com/bagreg.php?airid=16&airlinename=United%20Airlines If you click on some of the other airlines, such as Air Canada, it seems like the way my table is designed is a good way to display the information. To keep the database simple, I'm using the same table for every airline, that's why it has the same columns. Should I just change the design of the database and have a separate table for every airline? If I do that, it seems it destroys the point of using php and mysql, might as well just code the tables in html for every page. Thanks for your help. Quote Link to comment https://forums.phpfreaks.com/topic/191025-long-table-how-to-displaysplit-it-up/ Share on other sites More sharing options...
RussellReal Posted February 5, 2010 Share Posted February 5, 2010 trust me.. Be as vague as possible, like fit all the rules into the table, and if the airlines don't have those rules, then leave it blank.. #2 have 1 small table, 1 super long table not 1 table for each airline, and 1 table with just airline information like.. id, telephone number, fax number, customer support number, state, county, town, zip whatever would go in there then the super long table would be Airline ID, Class, Checked Bags, max Dimensions, Max Weight, remarks the first table mentioned, the smaller one.. should be just Airline ID, LuggageType, Quantity, Maximum Dimensions, Maximum Weight and in each table you put information from the airlines.. based on their Airline id number, which will be set up in the first table.. then you just when you go to luggageInfo.php?airlineId=1 // 1 being United Airlines then you grab from the big table and small table and display the info its quite simple Quote Link to comment https://forums.phpfreaks.com/topic/191025-long-table-how-to-displaysplit-it-up/#findComment-1007259 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.