in realtà servirebbe la QUERY, cioè dove viene definita la variabile $res con qualcosa come SELECT ..., comunque...

potresti fare comunque un'altra cosa:

Codice PHP:
<?php
  $j
=0// DA USARE PER LO STILE DELLA TABELLA
  
for ($i $startrec$i $reccount$i++)
  {
    
$row mysql_fetch_assoc($res);
    
$caputente '...'// IN QUESTO PUNTO DOVRESTI LEGGERE IL CAP DI RIFERIMENTO PRELEVANDOLO DAL DB O USANDO QUALCHE VARIABILE SETTATA IN PRECEDENZA
    
$filtrocap substr($caputente02); // USA I PRIMI DUE CARATTERI COME FILTRO (es. 12xxx)
    
$cap $row["CAP"]; // CAP DEL RECORD ATTUALE
    
$flag = (substr($cap0strlen($filtrocap))==$filtrocap); // VERIFICA CHE INIZI COME IL "FILTRO"
    
$style "dr";
    if (
$j++ % != 0) {
      
$style "sr";
    };
    
// L'IF SEGUENTE MOSTRA LA RIGA SOLO SE IL CAP RISPONDE AL FILTRO
    
if ($flag) {
?>
<tr>
<td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["CAP"]) ?></td>
<td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["NOME"]) ?></td>
<td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["CREDENZIALI"]) ?></td>
<td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["N.CIVICO"]) ?></td>
<td class="<?php echo $style ?>">[url="indirizzi.php?a=view&recid=<?php echo $i ?>"]Dettagli[/url]</td>
<td class="<?php echo $style ?>">[url="indirizzi.php?a=edit&recid=<?php echo $i ?>"]Modifica[/url]</td>
</tr>
<?php
    
};    
  }
  
mysql_free_result($res);
?>
per usare un filtro in PHP (cioè dal DB preleva tutto, ma poi "salti" i record che non vuoi mostrare)... la variabile $j è introdotta, perchè non si può più usare $i per lo stile della tabella, in quanto alcune righe verranno saltate. La variabile $caputente non posso sapere come inizializzarla... deve contenere il CAP di riferimento dell'utente loggato che sarà memorizzato da qualche parte nel DB.