> ...So the table song_x_artist contains references to all artists in a
> song and vice-versa.  (Field names correspond between tables.)

How does song_x_artist reference the other databases? Is there a way to set
up a field to always be a reference to another table?

I am not quite sure what you mean... but here is my take anyways. Is this
going around my elbow? Or is this just how you do relationals in SQL? ....

(For each relationship you may want to have in a system, you must set up a
table to house that relationship?)

Table::"song_x_artist"
*********************
PrimID (can't duplicate)
SongID (can duplicate)
ArtistID (can duplicate)

(PHP) & MySQL
*********************
$songID = (the id of the song the user selected to sample)
$artistsOnSong = Select * from "song_x_artist" where "songID" = $songID
while ($artistArray= mySQL_Fetch_Array ($artistsOnSong)){
   $currentArtists = Select * from "Artists" where artistID =
$artistArray[ArtistID]
   while ($artistInfo= mySQL_Fetch_Array ($currentArtists)){
      //start to build the html table of the related artists for the song
here.
   }
}

Would that work? And if it does... I am not so sure about how to write it
out, so if you have any suggestions on better syntax, please advise.

Thanks
Robbie

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to