Limiting the number of times displayed
For what im talking about please visit...
http://www.sublimestylee.com/pages/videos_artist.php
I had a solution to my problem on a different website I made but I cant log in to retrieve the code, it was pretty simple.
As you can see on that page it displays pepper twice and slightly stoopid many times. Thats because I have 2 pepper videos and several slightly stoopid videos. I only want it to be represented one time. That page should only show Pepper and then Slightly Stoopid on a seperate line.
Thanks
-drew
Greg K posted this at 01:07 — 27th August 2006.
He has: 2,145 posts
Joined: Nov 2003
There was an error is your SQL statemtent when I visited the page, so I couldn't see what you were talking about, however, if I am understanding you correctly, what you are wanting in the DISTINCT option to select only unique entries (remove duplicates).
Just guessing based on the error I'm given on your page, you would want something similar to this:
SELECT DISTINCT `artist` FROM `downloads` WHERE `filetype`='video' ORDER BY `artist`
'See http://dev.mysql.com/doc/refman/5.0/en/select.html for more info.-Greg
sublimer posted this at 01:15 — 27th August 2006.
They have: 41 posts
Joined: Aug 2006
thanks, i had my punction wrong. i remeber needing to inlcude DISTINCT.
this is what i had before your correction!
$sql = "SELECT DISTINCT 'artist' * FROM downloads WHERE filetype='video' ORDER BY artist ASC";
thanks alot Greg K
-drew
timjpriebe posted this at 13:54 — 28th August 2006.
He has: 2,667 posts
Joined: Dec 2004
You need to delete the *. That won't really even logically work with the distinct statement, but if you really want to display any other fields, you'll have to list them out specifically.
Tim
http://www.tandswebdesign.com
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.