July 17th, 2002, 11:33 AM
linking mysql tables
I recently started using mysql, and I'm trying out some stuff to learn a bit more. I decided to implement a small music charts system: it will hold the data telling you which song is on which position in a certain week. For now, I use two tables:
(..all the way to...)
The second table (song) holds information on the songs themselves. Index is a unique integer.
The first table (outlaw41) holds the information on the charts. Each week, a new row is added, reflecting the charts of that week (which song was on number one, which one was number 2, etc).
My question is: how do I link these tables? Somehow, I want to tell the [outlaw41] table that week3's position1 is the song with index x in the [song] table.
I wish to express my gratitude to the people of Italy. Thank you for inventing pizza.
July 17th, 2002, 10:29 PM
The best way would be to structure the table so that your Outlaw41 table contains the unique index values from the Song table rather than the song titles.
July 17th, 2002, 10:47 PM
having neber used mysql, this is all i can suggest...
but yes, moose is right. make sure you have identical keys in both tables and (i'm thinking of M$ access right now) there should be an option to link one to another. i'll have to dl mysql. i've been making the slow move away from M$ anyhow.[/edit]
just like water off a duck\'s back... I AM HERE.
for CMOS help, check out my CMOS tut