I need some help. I'm pulling data from my database into a file and creating links from that data to another page. What I want to do is use the variable I'm passing to query the database for the field I will use as the title of the page. I can't seem to get it to work.

My link is this: song.php?artist=3

then in the song.php I want to query the database with the artist variable and pull the artist name for the title of the page.

It is printing all the tags that it should but it isn't printing the actual field. I also have another query further down the page that works fine.

Can anyone make any suggestions on how to get the info I need? I'm only pulling one record with one field in the first query...the artist's name based on the artist #.

My select is: Select Name from artists where ID = $artist
I'm not sure the rest of my php code is correct though for pulling out the field from the result set.

Thanks in advance for any help you can give.