Oppure così

Codice PHP:
$total mysql_num_rows("SELECT id FROM immobili WHERE [clausola where]");