PHP - combox

 
Vista:

combox

Publicado por sentyluna (1 intervención) el 06/06/2008 18:14:38
hola mira lo uqe necesito es lo siguiente tengo una lista con el id y me debe de imprimir los nombre y los apellidos a que correspondeel id ya tengo el codigo lo que pasa es uqe dentro de este codigo hay un boton y se supone que cuando yo lo escoja automaticamente me imprima los valores del id y no puede haber ningun boton y fuera de eso necesito despue de ver los nombre pueda escoger otro id y el anterior no se de saparezca de la pantalla este es el codigo uqe tengo si alguien sabe se lo agradecaria

<html>
<head>
<title>Documento sin título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form name="form1" method="post" action="listo.php">
<?
$ID=$_POST ["ID"];
echo $ID;

$db = mysql_pconnect("localhost", "root", "");
if (!$db)
{
echo "Error: No se ha podido conectar a la base de datos. Por favor, prueba de nuevo más tarde.";
exit;
}
mysql_select_db("bdcoquette");
$consulta = "select PRINOM, SEGNOM, PRIAPE, SEGAPE from personal where ID like '%".$ID."%'";
$resultado = mysql_query($consulta);
$num_resultados = mysql_num_rows($resultado);

?>
<?

echo"<select name='ID' onchang 'mm_jumpmenu('parent',this,0)'>
<option value=0 selected>Seleccione...</option>";

$consulta1= "select * from personal";
$resultado1=mysql_query($consulta1,$db) or die("<br>Error ejecutando la Consulta1</body></html>");
$numero1=mysql_num_rows($resultado1);
while($numero1>0){
$fila1 = mysql_fetch_array($resultado1);
echo" <option value='".$fila1['ID']."'>".$fila1['ID']."</option>";
$numero1 = $numero1 - 1;
}
echo"</td></select>"; ?>
<?php
for ($i=0; $i <$num_resultados; $i++)
{
$row = mysql_fetch_array($resultado);
?>
<table width="387" border="1">
<tr>
<td width="99"><?php echo $row['PRINOM']; ?></td>
<td width="96"><?php echo $row['SEGNOM']; ?></td>
<td width="67"><?php echo $row['PRIAPE']; ?></td>
<td width="64"><?php echo $row['SEGAPE']; ?></td>
</tr>
<? } ?>
</table>
<input type="submit" name="Submit" value="Enviar">
</form>
</body>
</html>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder