salve ragazzi subito posto la query :
$sql = "SELECT * FROM messages where id_utente='$id_utente' and mandato_da='$id_ospite' ORDER BY id DESC";
allora questa e la select di una chat
allora id_utente equivale a quello che hanno mandato a me(potevo mettere nella tabella il nome "to")...