contador =0;
no te da un error ahi????
porque tendria que ser $contador =0;
por es no te muestra nada... cuando entras en el while y comparas $contador con 0... $contador no existe, es null.
por otra parte.. no creo que haga falta complicarse tanto... el bucle while sobra, porque solo quieres sacar un registro.. con hacer el $row=mysql_fetch_array($resultn); a secas ya tendrias ahi el primer registro, y al hacer el echo "VALOR DE ID -->".$row["subid"]."<--<br>";
ya se mostraria..
Código PHP:
$sqlrep = "select * from tabla where id='$id' and nivel='2'";
$resultn = mysql_query($sqlrep, $link);
if (mysql_num_rows($resultn) > 0)
{
$row = mysql_fetch_array($resultn);
echo "VALOR DE ID -->".$row['subid']."<--<br>";
};
vamos.. eso creo.. pruebalo a ver..