Ciao leslie2016
credo che il problema sia come hai strutturato le query. In questo tuo modo se l'ultimo utente della lista ha un'appuntamento il risultato sarà true di sicuro. Prova così: in questo modo con il break dovrebbe uscire se un utente non ha appuntamenti.
[COLOR=#0000BB][FONT=monospace]$query[/FONT][/COLOR][COLOR=#007700][FONT=monospace]= [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"SELECT * FROM utenti"[/FONT][/COLOR][COLOR=#007700][FONT=monospace];
[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$Recordset [/FONT][/COLOR][COLOR=#007700][FONT=monospace]= [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]mysql_query[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$query[/FONT][/COLOR][COLOR=#007700][FONT=monospace], [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$mcl[/FONT][/COLOR][COLOR=#007700][FONT=monospace]) or die([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]mysql_error[/FONT][/COLOR][COLOR=#007700][FONT=monospace]());
while([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$row[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]mysql_fetch_row[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$Recordset[/FONT][/COLOR][COLOR=#007700][FONT=monospace]))
{
[/FONT][/COLOR][FONT=monospace][COLOR=#007700] [/COLOR][/FONT][COLOR=#0000BB][FONT=monospace]$id_utente_abilitato[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$row[/FONT][/COLOR][COLOR=#007700][FONT=monospace][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]0[/FONT][/COLOR][COLOR=#007700][FONT=monospace]];
[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace] $query_a[/FONT][/COLOR][COLOR=#007700][FONT=monospace]= [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"SELECT * FROM appuntamento where giorno_app='[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$data_appu[/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]' and ora_inizio<='[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$ora_cont[/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]' and ora_fine>='[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$ora_cont[/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]' and id_utente='[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$id_utente_abilitato[/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'"[/FONT][/COLOR][COLOR=#007700][FONT=monospace];
[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace] $Recordset_a [/FONT][/COLOR][COLOR=#007700][FONT=monospace]= [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]mysql_query[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$query_a[/FONT][/COLOR][COLOR=#007700][FONT=monospace], [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$mcl[/FONT][/COLOR][COLOR=#007700][FONT=monospace]) or die([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]mysql_error[/FONT][/COLOR][COLOR=#007700][FONT=monospace]());
$entrato = false;
while([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$row_a[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]mysql_fetch_row[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$Recordset[/FONT][/COLOR][COLOR=#007700][FONT=monospace]))
{
$entrato = true;
[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$id_libero[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$row_a[/FONT][/COLOR][COLOR=#007700][FONT=monospace][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]0[/FONT][/COLOR][COLOR=#007700][FONT=monospace]];
}
if($entrato==false)
break;
}
[/FONT][/COLOR]