Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/144809-solved-relationships-in-mysql/
Share on other sites

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

 

 

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.

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.