Jump to content

Recommended Posts

I'm making a site where people can upload effect pedal settings for songs. So I have a list of pedals, lets say I have 2 in the list, wah 1 and wah 2. I'm trying to count how many songs use each pedal. Problem is, there could be 2 different settings for the same pedal (dependng on how fast you want to play it, etc).

 

So if we have 2 songs, song 1 and song 2, and they each have 2 settings, my num_rows query will return 4. However, I only want it to return 2 since I'm counting songs, not individual effects. Is there any way to do this?

 

SELECT * FROM effects WHERE song='$song_id' AND pedal='$pedal_id'

 

Is the query I have now.

Link to comment
https://forums.phpfreaks.com/topic/65010-ignoring-duplicate-sql-results/
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.