Codice PHP:
function UsersOnline(){
    include
"config.inc.php";
    
mysql_select_db($database_name$conn) or die ("Errore nel selezionare il db: " mysql_error());
    
$sql "SELECT * FROM tb_login WHERE lg_useronline = 1";
    
$query mysql_query($sql) or die ("Errore nella query: " mysql_error());
    
$html "";
    while(
$result mysql_fetch_assoc($query)){
        
html .= $result['lg_usr'] . ", ";
        }
     
$html substr($html,0,strlen($html)-2);
     echo 
$html;