Jump to content

Recommended Posts

Hi guys,

 

Im starting a new project, just to help me get to grips with php and mysql!

 

I was hoping that some one could check my table designs, as im not sure they are quite right.

 

House//

 

House ID - Auto inc + unique

photo ID

User ID

summary

tenure

Type ID

Price

bedrooms

Reception rooms

bathrooms

county

town/city

condition

floor plan

details

post code

location type

chain

features

map

 

User//

 

user ID

Username

password

email

 

photos//

 

Photo ID

photo

 

type//

 

Type ID

Type

 

Is this normalised? I think I have done some of it, but not done this for a while, so cant quite remember!

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/60078-advertising-houses-database/
Share on other sites

If you're House.PhotoID is only going to point to a record with a single other value, you might as well just store that other value in the House table.  However, what happens if I want to upload multiple pictures for a single house?  Your current design would require multiple duplicate records in the House table with only the PhotoID field changing.

 

I suggest removing PhotoID from the House table altogether.

 

Instead, change your Photo table to:

id

houseID

file

 

Then you will be able to upload multiple files for a single house.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.