Código PHP:
<!DOCTYPE html>
<?php
include('../php/validarusuario.php');
$consulta='SELECT * FROM usuarios;';
$query=$conexion->query($consulta);
$pass=md5('999999');
?>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0">
<title>Ingresar al sistema</title>
<link href="../css/normalize.css" rel="stylesheet">
<link href="../css/skeleton.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="../css/main.css">
<link rel="stylesheet" type="text/css" href="../css/tablas.css">
</head>
<body class='cuerpo'>
<header>
<a href='../inicio.php'><img src="../img/cabecera.png" alt='cabecera' width='1200px'></A>
</header>
<div class="row">
<div class="table-title">
<h3>Usuarios Registrados</h3>
</div>
<table class="table-fill">
<thead>
<tr>
<th class="text-left">Usuarios</th>
<th class="text-left">Cedula</th>
<th class="text-left">Tipo</th>
<th class="text-left">Estatus</th>
</tr>
</thead>
<tbody class="table-hover">
<tr>
<?php while ($resultado=$query->fetch_assoc()){
print ('<tr><td class="text-left">'.$resultado['nombre_usuario'].'</td>
<td class="text-left">'.$resultado['cedula'].'</td>');
if($resultado['tipo']=='1'){
print('<td class="text-left">Administrador</td>');
}else{
print('<td class="text-left">Usuario</td>');
}
if ($resultado['clave_usuario']==$pass)
{
print("
<td>
<form action='../php/cambioestatus.php' method='post' id='form'>
<select class='seleccion' name='clave' style='color:black;'>
<option style='background-color:green;' value='1'>ACTIVO</option>
<option style='background-color:red;' selected value='999999'>BLOQUEADO</option>
<input type='hidden' id='valor' name='nombre' value='".$resultado['nombre_usuario']."'/>
</form>
</select></td>
</form>
"
);
}
else{
print(" <form action='../php/cambioestatus.php' method='post' id='form'>
<td><select class='seleccion' name='clave' style='color:black;'>
<option style='background-color:green;' selected value='1'>ACTIVO</option>
<option style='background-color:red;' value='999999'>BLOQUEADO</option>
<input type='hidden' id='valor' name='nombre' value='".$resultado['nombre_usuario']."'/>
</select></td></tr>
</form>"
);
}
}
?>
este es la pantalla que imprime
![](http://i67.tinypic.com/1zxr3hl.jpg)
depurando podemos notar que solo me devuelve siempre los primeros datos de la primera fila entonces ese es problema quiero que me seleccione el nombre de usuario de esa fila