Jump to content

Recommended Posts

I'm in the process of building a real estate site for a 'client'. I was wondering, would it be wiser to just make 1 table, and put every attribute of the house in it? With an House ID, to call a page, to view a certain house in more details. And also, if the house has multiple pictures for preview, would they all be in the same table?

 

I have a thought on how to do it, but mostly i wanted to find out if it'll be better to use 1 table, or if anybody else has any more ideas

Link to comment
https://forums.phpfreaks.com/topic/51707-php-mysql-real-estate/
Share on other sites

I would ask your client for as many house descriptions as possible and look for the common trends.  You will likely find certain features are common to all houses and certain features are common to certain types of houses.  That will give you a better idea of how you should organize your data.

 

You can't possibly develop a sufficient database if you don't know anything about the data you'll be storing.

Link to comment
https://forums.phpfreaks.com/topic/51707-php-mysql-real-estate/#findComment-254808
Share on other sites

Ok, tnx...I'm probably going to create a different table for the previews of the houses. How would the person updating the site be able to insert a new house, and photo the same time, and have them associated with the same ID. Right now I have the a field for ID, in the house table, which increases automatically. How would the pictures get the same ID. If they haven't been inserted yet?Should I built a function to automatically check the number of ID in the House value and assign the pictures of the house an ID of +1?

 

Just looking for some thoughts

Link to comment
https://forums.phpfreaks.com/topic/51707-php-mysql-real-estate/#findComment-257154
Share on other sites

Give each property a reference code that has to be entered when entering the property, then you can use this in your image file names.

 

That's the way the system I develop works.

 

My system has all the info in one table (I didn't do the initial dev) and it seems to work well that way.

Link to comment
https://forums.phpfreaks.com/topic/51707-php-mysql-real-estate/#findComment-261464
Share on other sites

I'm thinking have a table for all the house information, and then a table called "gallery" or something similar, and thats where you store information about the pictures, with coulmns like id, house_id, path, caption.

 

and when adding a new house, simply add the house first, then use the mysql_last_id (i forget what it's called), and then use that for the insert to gallery upload query

Link to comment
https://forums.phpfreaks.com/topic/51707-php-mysql-real-estate/#findComment-262750
Share on other sites

  • 1 month later...

You could, but if one of principal vendors is, say, "Cholmondley Featherstonehaugh and Partners, Real Estate Agents" then you have to hold all that in dozens of records (and there's a good chance it will be mis-spelt in several of them)

 

If it's in a separate table you only hold it once and store the id (int) in each of the records instead.

 

Searching for vendor = 42 is much faster than searching for vendor = "Cholmondley Featherstonehaugh and Partners, Real Estate Agents"

Link to comment
https://forums.phpfreaks.com/topic/51707-php-mysql-real-estate/#findComment-293955
Share on other sites

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.