eZe616 Posted May 16, 2007 Share Posted May 16, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/51707-php-mysql-real-estate/ Share on other sites More sharing options...
roopurt18 Posted May 16, 2007 Share Posted May 16, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/51707-php-mysql-real-estate/#findComment-254808 Share on other sites More sharing options...
eZe616 Posted May 19, 2007 Author Share Posted May 19, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/51707-php-mysql-real-estate/#findComment-257154 Share on other sites More sharing options...
richclever Posted May 25, 2007 Share Posted May 25, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/51707-php-mysql-real-estate/#findComment-261464 Share on other sites More sharing options...
gabeg Posted May 27, 2007 Share Posted May 27, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/51707-php-mysql-real-estate/#findComment-262750 Share on other sites More sharing options...
Barand Posted June 2, 2007 Share Posted June 2, 2007 In addition you'll need other tables such as vendor, property type (house, apartment, land etc), location Quote Link to comment https://forums.phpfreaks.com/topic/51707-php-mysql-real-estate/#findComment-266786 Share on other sites More sharing options...
eZe616 Posted July 9, 2007 Author Share Posted July 9, 2007 In addition you'll need other tables such as vendor, property type (house, apartment, land etc), location Couldn't you put all those type in the table with the house information, and search them regarding the tables field? Or is that inefficient Quote Link to comment https://forums.phpfreaks.com/topic/51707-php-mysql-real-estate/#findComment-293943 Share on other sites More sharing options...
Barand Posted July 9, 2007 Share Posted July 9, 2007 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" Quote Link to comment https://forums.phpfreaks.com/topic/51707-php-mysql-real-estate/#findComment-293955 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.