Codice PHP:

echo($row['id_agenti'] != 1000) ? ( $row['id_agenti']) : ( "" ); 
Anche cosi' tutto su una riga se vuoi.