inspireddesign Posted April 13, 2009 Share Posted April 13, 2009 Hello All, Hope everyone had a nice Easter. My problem is this: I have a large database that has unique ID numbers but some of the information has the same ID. For example: In my case I have a table that has client information with a unique ID of say 100. And I have another table called aircraft which has a field called client_id and airport_id. This client with the unique ID of 100 has more than one aircraft and each of his aircraft in the table 'aircraft' has the client ID of 100. I would like to extract or query the aircraft for this client in some way that it can be displayed easily. I'm sure you are saying that's easy you just do the following: SELECT * FROM `aircraft` WHERE client_id = 100; Well here's my real problem. I need to take that same data array and segment the data so it's not just a dump of information. I want the output to be "Aircaft1 Data Chuck", "Aircaft2 Data Chuck", "Aircaft3 Data Chuck", etc. Can someone give me a hand? Thanks a bunch, Damian Quote Link to comment https://forums.phpfreaks.com/topic/153858-querying-data-that-has-the-same-id/ Share on other sites More sharing options...
revraz Posted April 13, 2009 Share Posted April 13, 2009 Since you are already selecting all rows, I assume you want to display the result using something like PHP? If so, just display it in a HTML Table. Quote Link to comment https://forums.phpfreaks.com/topic/153858-querying-data-that-has-the-same-id/#findComment-808892 Share on other sites More sharing options...
mandred Posted April 14, 2009 Share Posted April 14, 2009 Go to PHP.net and search for the mysql_fetch_assoc function. Or do all the MySQL tutorials here: http://www.tizag.com/mysqlTutorial/mysqlselect.php Quote Link to comment https://forums.phpfreaks.com/topic/153858-querying-data-that-has-the-same-id/#findComment-809078 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.