Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/10/2010, 14:23
dianays
 
Fecha de Ingreso: agosto-2010
Mensajes: 147
Antigüedad: 13 años, 8 meses
Puntos: 1
Pregunta Quiero mostrar mas de un dato...

Tengo un problema, lo que sucede que quiero que me muestre los datos del usuario que seleccione por ejemplo: si selecciono el nombre de Yolanda me debe mostrar el folio, fecha, hora, unidad y nombre, pero solo me muestra un dato de esa persona y existen dos datos de ella... entonces no se como hacer para que me muestre todos los datos de esa misma persona...

Aqui les dejo lo que tengo:

<html>
<body>
<form name="form1" method="post" action="">
<label><strong>Personal:</strong>
<select name="nombre" id="nombre">
<option selected>[Seleccione...]</option>
<option value="1">Beatriz</option>
<option value="2">Diana</option>
<option value="3">Pablo</option>
<option value="4">Maria</option>
<option value="5">Rosa</option>
<option value="6">Yolanda</option>
</select>
</label>
<p>
<label>
<input name="ACEPTAR" type="submit" id="ACEPTAR" value="Aceptar">
</label>
</p>
</form>

<?php
$CONEXION = mysql_connect("localhost","localhost","");
mysql_select_db("bd_control", $CONEXION);
?>

<?php
if (isset($_POST["ACEPTAR"])){
$ART=$_POST["nombre"];
$ART_SEL=mysql_query
("SELECT folio, fecha, hora, unidad, nombre
FROM reporte, unidades, usuarios
WHERE reporte.id_unidad=unidades.id_unidad
AND reporte.id_nom=usuarios.id_nom
AND reporte.id_nom=$ART");
$error=mysql_error($CONEXION); echo $error;
$fila=mysql_fetch_array($ART_SEL);
if(mysql_num_rows($ART_SEL)){
echo "<table width='800' border='1' align='center'>
<tr>
<th width='90' scope='col'>FOLIO</th>
<th width='66' scope='col'>FECHA</th>
<th width='65' scope='col'>HORA</th>
<th width='69' scope='col'>UNIDAD</th>
<th width='66' scope='col'>NOMBRE</th>
</tr>
<tr>
<td>".$fila['folio']."</td>
<td>".$fila['fecha']."</td>
<td>".$fila['hora']."</td>
<td>".$fila['unidad']."</td>
<td>".$fila['nombre']."</td>
</tr>
</table>";
}
else{
echo "<div class='Estilo2' align='center'>No existe reporte</div>";
}
}
?>
</body>
</html>