lilryansd Posted June 13, 2009 Share Posted June 13, 2009 Hello and thank you for taking the time read my post. I have a very simple datbase design question. I have a section on a wbsite that list properties. I am seting up a simple CMS to create add and modify the properties. the site is currently static html but the record sets will be layed out the same here is a reference url for the layout. http://prioritysuites.com/listings_archstone_san_diego.php I am going to set up a table a call it properties and this table will have the following fields: pID - primary ID pName - name of property pDiscript - description pAddress - address pCity - city pMainImg - the large main img pSmallImg - smaller thumbnail pics pAmentities - list of amenties pComFeatures - list of cummunity features pApi - api number for google maps I have not worked with any relationships yet but I have read a lot on the subject. the three fields pSmallimg, pAmentites, pCommFeatures, will be link to other tables. I will create three new tables tbl_smalImg, tbl_amentites, and tbl_CommFeatures. Each table will have the following fields --------------------------- tbl_smalImg --------------------------- smlImgID -priamry key pID -property id number image_sml - file anme of the image ---------------------------- =========================================== --------------------------- tbl_amentites --------------------------- amentID -priamry key pID -property id number amentField - file anme of the image ---------------------------- =========================================== --------------------------- tbl_comFeat --------------------------- comFeatID -priamry key pID -property id number featComField - file anme of the image ---------------------------- =========================================== now my question is, is this the correct way to set up the database tables? if I wanted to list all the properties in the database what would the SQL code be to pull info form each table so each property will list all the small images, amenities and community features. once again I thank you for looking this over I will forward to any help that you have. RB Quote Link to comment https://forums.phpfreaks.com/topic/162051-table-set-up-and-relationship-query-question/ 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.