Originariamente inviato da ade_v
prova così:

$query2 = mysql_query("SELECT id FROM tb2 Order by
id DESC Limit 0,1") or die (mysql_error());

while($result2 = mysql_fetch_array($query2) ) {
$id = $result2['id'];
echo $id.'
';
}
Niente da fare, dopo il primo while non stampa nulla, se poi per provare metto prima il codice che mi hai passato tu viene stampato solo quest'ultimo.

Tenete conto che non ricevo nessuna notifica di errore e ho anche i notice abilitati nell'error_reporting