Jump to content

[SOLVED] Im Stuck


Northern Flame

Recommended Posts

I created a page on my website that displays the artists of songs uploaded on my website,

and I want to make it so that when you click on the artist, it will display all of his/her songs

without me having to create a page for every artist and manually having to input their song titles.

I've already made it so that it displays the artists, but I have no idea how to make it display all

the songs that I have on my website that are by the artist that the user selects, I've tried so many things

and none seem to work  :-[

heres the code that displays the artists, maybe this can help anyone who tries to help me,

 

while($row = mysql_fetch_array($sql)){
$artist = $row['name_artist'];
echo "<a href=\"".$_SERVER['PHP_SELF']."?artist=$artist\">".$row['name_artist']."</a><br /><br />";
}

 

ANY SUGGESTIONS WILL BE GREATLY APPRECIATED!  :)

Link to comment
Share on other sites

Have you got another table for the songs?

 

so you would have:

 

artists with:

id

name

anything else

 

songs with:

id

name

anything else

 

artist_song_join with

artist_id

song_id

 

then you would use the artist_song_join to get the relevant songs from the database and display them on the artist's page.

Link to comment
Share on other sites

I have two tables,

mp3_artists

mp3_musics

 

mp3_artists:

 

- id_artist

- name_artist

 

mp3_musics

 

- id_music

- title_music

- playlist_music

- date_music

- active_music

 

I can create a table joining the two,

but how would I get the song titles to be displayed on

the artist page? How can I tell the script to display

the music of the artist that is clicked on?

Or do I create a seperate page, lets say "artist_music.php",

but still, how will I tell the script to only display the music from the

artist that was clicked on?

The only solution I came up with was to make a page for each artist

and manually put in the music names, but if theirs a way to do one of the first two

options I WOULD MUCH RATHER PREFER TO DO THAT!  ;D

Link to comment
Share on other sites

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.