Codice PHP:
case 'names':
        
$sql "SELECT DISTINCT U.user_id as user_id, S.user_id as user_id_session, U.username as username
                FROM " 
$_CONFIG['table_sessioni'] . " S," .$_CONFIG['table_utenti']." U
                WHERE S.user_id = U.user_id"
;
                
$result=mysql_query($sql);
                while (
$row mysql_fetch_array($result))
                {echo 
"<a href=\"$_CONFIG[forum_path]profile.php?mode=viewprofile&u=$row[user_id]\" target=\"_blank\">$row[username] </a>";}
            break;

         } 
Questa query ha il compito di scrivere dentro un unico <td> gli user attualmente loggati nel sito, però vorrei limare la query mettendo una virgola dopo ogni user e un punto dopo l'ultimo.

Se semplicemente aggiungo "," alla query anche l'ultimo elemento avrà ","
Come faccio a dire di metterla a tutti tranne all'ultimo che avra' "." ?