Tengo el siguiente código
Código PHP:
$nCont=0;
while ($row2 = mysql_fetch_array($result2)){
?>
<tr>
<td><center><b><?php echo trim($row2["COMPANIA"]);?></b><input type="hidden" name="compania" value="<?php echo trim($row2["COMPANIA"]);?>"></center></td>
<td><right><b><?php echo trim($row2["CALLE"]); ?></b><input type="hidden" name="calle" value="<?php echo trim($row2["CALLE"]);?>"></right></td>
<td><right><b><?php echo trim($row2["POBLA"]); ?></b><input type="hidden" name="poblacion" value="<?php echo trim($row2["POBLA"]);?>"></right></td>
<td><right><b><?php echo trim($row2["PROVIN"]);?></b><input type="hidden" name="provincia" value="<?php echo trim($row2["PROVIN"]);?>"></right></td>
<td><right><b><?php echo trim($row2["CP"]); ?></b><input type="hidden" name="cp" value="<?php echo trim($row2["CP"]);?>"></right></td>
<td colspan=5 align=center><br><input type=submit value='Confirmar'></br></center></td>
</tr>
<?php
$nCont += $nCont+1;
}
Bueno pues algo tengo mal en éste codigo, ya que si tenemos 10 registros, aunque pinche en el primero, siempre me devuelve los valores del último, es como si el while, recorriera toda la tabla, y se queda en el último, y aunque elija el primero, siempre asume que he pinchado n el último, no sé si me explico.
Alguna ayuda?
Saludos