Jump to content

Ignoring duplicate SQL results?


hatrickpatrick

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.