Hi, On my data base a user an upload a set number of pics. At the mo I have a script that displays the last 5 users with pics uploaded. However I need to get it to only display 1 pic per username. How would i do this ? Script sample- <? $sql="select * from photos where approved='Y' order by upldate DESC LIMIT 5"; $result = mysql_query($sql); $count=mysql_num_rows($result); $res=mysql_query($sql); while($obj=mysql_fetch_object($res)) { if($obj->url=="") { $img="<a target='_blank' href='../pics/$obj->filename'><img border=0 width=100 height=100 src='../pics/$obj->filename'></a>"; } else { $img="<a target='_blank' href='$obj->url'><img border=0 width=100 height=100 src='$obj->url'></a>"; } $id=$obj->photosid; $username=$obj->username; ?> <td width="30%" align="center"><? print $img; ?></td> <td width="20%"><a href="javascript:popupWindow('<? print $username; ?>');"><? print $username; ?></a></td> <? } if($count!=0) { ?> <? } ?> PHP: