I'm no expert, but this works for me:
$result = mysql_query("SELECT DISTINCT name,surname,web FROM members WHERE web != ' ' ORDER BY surname ASC");
This selects distinct results from the members table where the web field (containing URLS) is not (!=) blank. The list generated is also put in ASCending order by surname.
It might be helpful for you?
I'm not sure but in your case try...
$result = mysql_query("SELECT DISTINCT id,login FROM tablename WHERE 1 ORDER BY login ASC");
Hope this helps :queasy: Just getting the hang of this myself.