MySQL Forums
Forum List  »  PHP

Re: One to Many Relationships in MySQL with PHP
Posted by: Thomas Ljungstrom
Date: June 08, 2006 04:56AM

Hi!

In MySQL you donĀ“t create an relation. You do it every time in your sql-statements with JOIN.
Make sure that your table Wrote have a primary id of both BookNum AND AuthorNum

CREATE TABLE `wrote` (
`booknum` int(11) NOT NULL default '0',
`authornum` int(11) NOT NULL default '0',
PRIMARY KEY (`booknum`,`authornum`)
) TYPE=MyISAM;

Options: ReplyQuote


Subject
Written By
Posted
Re: One to Many Relationships in MySQL with PHP
June 08, 2006 04:56AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.