kulmu Posted May 11, 2007 Share Posted May 11, 2007 Basically the end result for this is to manage rental properties. "properties" is the main table that handles most the information. It has about 50 rows so I am not sure you need all the rows, but if you do let me know. The second table has floor plans. I named this table "floorplans". It has several rows: PlanID PropID - this is the same one from the properties table that they both share PlanName Size Bedrooms Bathrooms Den Price PriceTo Deposit SqFt UnitImg I am attempting to build a cataloging system and display the results as a set on the page. I am listing 10 items per page with various sub info on that page as well. Most of this information is in the primary 'properties' table, but I would also like to be able to list items from the sub table that match the primary ID all on the same page. A detailed page containing all the information on the subject would be easier to do since I could just call the ID from the $_GET on two separate querrys but I am trying to make a page to give previews before clicking through. Any help is greatly appreciated. Link to comment https://forums.phpfreaks.com/topic/51005-pulling-data-from-two-tables/ Share on other sites More sharing options...
cmccully Posted May 11, 2007 Share Posted May 11, 2007 Hi, I am unclear as to what you are asking. Do you need help with the queries to pull the data from the tables or help with displaying the info to the web page? Curtis Link to comment https://forums.phpfreaks.com/topic/51005-pulling-data-from-two-tables/#findComment-250985 Share on other sites More sharing options...
kulmu Posted May 12, 2007 Author Share Posted May 12, 2007 I guess a lil of both if possible. Link to comment https://forums.phpfreaks.com/topic/51005-pulling-data-from-two-tables/#findComment-250988 Share on other sites More sharing options...
kulmu Posted May 14, 2007 Author Share Posted May 14, 2007 Any help with this would be greatly appreciated. I still can't seem to find a way to accomplish what I am looking for. Link to comment https://forums.phpfreaks.com/topic/51005-pulling-data-from-two-tables/#findComment-252711 Share on other sites More sharing options...
irvieto Posted May 16, 2007 Share Posted May 16, 2007 How is going to be the preview? It could be a popup that opens when you click an specific link in the list? If so, you can use another file for the popup window which also receives a GET param, and show the information what you want. I am a little bit confused with: "but I would also like to be able to list items from the sub table that match the primary ID all on the same page" I guess you want to show information from both tables in the items on the list. In that case you will need to execute a query that joins those tables using the PropID as the "linker". If is not that case. Just ignore the following code. Example. $sql = "select a.*,b.Bedrooms,b.Bathrooms from properties as a,floorplans as b where a.PropID=b.PropID" This query will give you all the information from table properties and the Bedrooms,Bathrooms from the floorplans table. All this info in the same row per result. Hope this helps. --> irvieto <-- Link to comment https://forums.phpfreaks.com/topic/51005-pulling-data-from-two-tables/#findComment-254235 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.