Lukey Posted May 24, 2007 Share Posted May 24, 2007 Yup im a newbie that doesnt understand the major differences in MS Access relationships and the way its done in mySQL any input would be appreciated The problem: I have a table called "house" with the house's address etc in it: CREATE TABLE `house` ( `id` int(11) NOT NULL auto_increment, `hname` varchar(20) default NULL, `hnum` varchar(5) default NULL, `hstreet` varchar(20) default NULL, `htown` varchar(30) default NULL, `harea` varchar(30) default NULL, `hcounty` varchar(20) default NULL, `hcountry` varchar(25) default NULL, `hprice` varchar(9) default NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 Im attempting to create a separate table that holds extra details about the houses such as number of bedrooms etc. How would i link the two together using the "id" key in the house table? Thanks for the time. Quote Link to comment https://forums.phpfreaks.com/topic/52740-relationship-woes/ Share on other sites More sharing options...
hitman6003 Posted May 24, 2007 Share Posted May 24, 2007 JOINs http://dev.mysql.com/doc/refman/5.0/en/join.html Quote Link to comment https://forums.phpfreaks.com/topic/52740-relationship-woes/#findComment-260444 Share on other sites More sharing options...
Lukey Posted May 24, 2007 Author Share Posted May 24, 2007 Is that all i need? a left join? i checked through a load of stuff and it seemed that i might need a foreign key or something along those lines. If i use the join command will it keep the tables separate? Quote Link to comment https://forums.phpfreaks.com/topic/52740-relationship-woes/#findComment-260447 Share on other sites More sharing options...
Wildbug Posted May 24, 2007 Share Posted May 24, 2007 If i use the join command will it keep the tables separate? JOIN is a method of returning a result set, not actually merging the tables permanently or anything. It puts the "relational" in RDBMS. Quote Link to comment https://forums.phpfreaks.com/topic/52740-relationship-woes/#findComment-260827 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.