<?PHP
session_start();
$select=mysql_query("SELECT * FROM mytable ORDER BY name ASC") or die (mysql_error());
while($result=mysql_fetch_array($select)){
if($result['name']==$SESSION['name']){
echo ".....";
}else{
echo $result['name'];
}
$SESSION['name']=$result['name'];
}
?>