Se il resultset è vuoto non entra proprio nel while !

Codice PHP:
if (mysql_fetch_row($res2) == 0) {
    ...