LiamH Posted February 11, 2009 Share Posted February 11, 2009 Hi again all. In SQL Server for example, if you have 2 tables that have a relationship together, you use Reference to make this relationship. Is there anything in MySQL that does the same thing? I am aware of JOIN, but I understand this is just for joining data when running a SELECT statement? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/144809-solved-relationships-in-mysql/ Share on other sites More sharing options...
premiso Posted February 11, 2009 Share Posted February 11, 2009 I do know the table type has to be InnoDB for this functionality. http://dev.mysql.com/doc/refman/5.1/en/innodb.html For usage on creating the tables to link to each other: http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.html Quote Link to comment https://forums.phpfreaks.com/topic/144809-solved-relationships-in-mysql/#findComment-759881 Share on other sites More sharing options...
LiamH Posted February 11, 2009 Author Share Posted February 11, 2009 Thanks a lot. I thought there would be something, but the books I have for some reason don't mention REFERENCE Quote Link to comment https://forums.phpfreaks.com/topic/144809-solved-relationships-in-mysql/#findComment-759904 Share on other sites More sharing options...
premiso Posted February 11, 2009 Share Posted February 11, 2009 Thanks a lot. I thought there would be something, but the books I have for some reason don't mention REFERENCE It very well could be they were writing it designed for Mysql 3.x, and in that version InnoDB was not enabled by default. That and really a lot of people disregard that cause it makes it a "headache" for some stuff to do. Doing it without the relationship makes stuff a bit simpler when it comes to some tasks, when it comes to others, such as removing a whole section and having it cascade down it makes it a ton easier. Quote Link to comment https://forums.phpfreaks.com/topic/144809-solved-relationships-in-mysql/#findComment-759910 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.