Jump to content

Recommended Posts

Hi, long time no see everybody.

 

Basically my problem, i want to have all of the artists displayed in a nice little box, but i don't know how to make PHP check for the same artist name when looping through the table. Here is my code:

 

<?php 

while($song = mysql_fetch_array($query)) {

?>
<span class="artist"><center><a href="browsesongs.php?artist=<?php echo $song['artist']; ?>">
<img src="images/art.gif" class="art" width="75" height="75"><br><?php echo $song['artist']; ?></a></center></span>
<?php 

}

?>

 

I have the connect statements and everything, but it displays Linkin Park twice, which i know why it does. How can i do a check to see if Linkin Park comes up again and make sure it doesn't display?

 

Here is the query:

 

<?php

$query = mysql_query("SELECT * FROM muzic");

?>

 

Thanks

heres the exported mysql table structure:

 

CREATE TABLE muzic (
  id smallint(10) NOT NULL auto_increment,
  songname varchar(100) NOT NULL default '',
  artist varchar(255) NOT NULL default '',
  mp3 varchar(255) NOT NULL default '',
  PRIMARY KEY  (id)
) TYPE=MyISAM;

 

It's the easiest way for me as i don't really want more than 1 table

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.