$total = 0;while($fila=mysql_fetch_array($consulta)){ if( $fila['definitiva'] < 60 ){ $total ++;}//y muestro los resultados } echo $total;