Forums
This topic is locked
Many to Many relationships with DMX and SQL SERVER
Posted 06 Aug 2003 18:06:34
1
has voted
06 Aug 2003 18:06:34 Elisa James posted:
For the past three weeks I have been working on many to many relationships using SQL Server 2000 database and Dreamweaver Application.In order to understand my problem let briefly explain an example I am using to test with.
CUSTOMER----rate-----MOVIES
Many customers can rate many different movies and vice versa. Therefore I will normalize this by creating a table called "RATING" with referential foreign keys "CUS_ID and MOVIE_NAME"( the two primary keys from the CUSTOMER and MOVIES) and a column called Rate which is an integer 1-5 . So in Dreamweaver I have three different insert forms. 1) Customer- allows user to create new customer 2) Movies-allows user to add a movie. 3)Rate- allows user to selct their name dynamically and select more than one movie at a time and then choose a rating (1-5). The Rate form information should go into the "Rating" table.
My problem is: when the user submits the information from the Rate form. The data goes into the rating table not as a list. In other words, in the CUS_ID column you will have the number and in the MOVIE_NAME column you will have all the movie selected using a comma as a delimiter. Instead I want the CUS_ID to be repeated in every row for every movie. Here is a visual of what I am saying:
WHAT I HAVE NOW:
CUS_ID MOVIE_NAME RATING
2222 X2,Matrix,Hulk 3
WHAT I WANT:
CUS_ID MOVIE_NAME RATING
2222 X2 3
2222 Matrix 3
2222 Hulk 3
I have tried scripting the table myself and looking on different sites for a solution but nothing is working. Please Help this is for my job and I do not have any resources here to get the information I need. If you are unable to help me is there, if you could suggest someone for me to talk to or email would be great. Thanks.
Elisa
Replies
Replied 13 Aug 2003 07:08:28
13 Aug 2003 07:08:28 Cathy French replied:
Don't know if this will help. But the Tutorial section on this site has an SQL section. Email address of the authors are sometimes listed.
Good Luck
Good Luck