Ver Mensaje Individual
  #4 (permalink)  
Antiguo 29/03/2011, 11:44
jjnel
 
Fecha de Ingreso: marzo-2010
Ubicación: colombia_santander
Mensajes: 68
Antigüedad: 14 años, 1 mes
Puntos: 0
Respuesta: porque no se llena el combo?

este es mi codigo completo:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
<!--
body {
background-color: #CCCCCC;
background-image: url();
}
body,td,th {
color: #0000CC;
}
.Estilo3 {font-: 16px}
.Estilo4 {color: #FF0000}
-->
</style>
</head>
<body>
<form name="form" action="busca.php" method="post">
<?php
$conexion=mysql_connect("localhost","root","") or die("Problemas en la conexion");
mysql_select_db("mtto",$conexion) or die("Problemas en la selección de la base de datos");
$sql="SELECT * FROM maquina";
$result=mysql_query($sql);
echo '<select name="nombre_dado" id="nombre_dado" onchange="this.form.submit()">' ;
while ($row=mysql_fetch_row($result))
{
$id=$row['id'];
$nombre=$row['nombmaq'];
echo "<option value=".$id.">".$nombre."</option>";
}
echo "</select>
</form>";
$id=$_POST['id'];
$sql1="select * from maquina where id='$id'";
$eje=mysql_query($sql1);
echo '<table border="1" cellspacing="1" cellpadding="1">
<tr>
<td bgcolor="#FFFFFF"><span class="Estilo4"><strong>&nbsp;Nombre de la maquina..</strong></span></TD>
<td bgcolor="#FFFFFF" class="Estilo4"><strong>&nbsp;tipo de mantto..&nbsp;</strong></TD>
<td bgcolor="#FFFFFF" class="Estilo4"><strong>&nbsp;operario a cargo..&nbsp;</strong></TD>
<td bgcolor="#FFFFFF" class="Estilo4"><strong>&nbsp;fecha inicio..&nbsp;</strong></TD>
<td bgcolor="#FFFFFF" class="Estilo4"><strong>&nbsp;fecha final..&nbsp;</strong></TD>
</tr>';
while($row = mysql_fetch_array($eje))
{
$nombre=$row["nombmaq"];
$tipo=$row["tipmtt"];
$operario=$row["operario"];
$fechainicio=$row["fechi"];
$fechafinal=$row["fecht"];
echo "<tr>
<td>
<input type='text' name='nombmaq' size='50' maxlength='30' value='".$nombre."'>
</td>
<td>
<input type='text' name='tipmtt' size='20' maxlength='20' value='".$tipo."'>
</td>
<td>
<input type='text' name='operario' size='20' maxlength='30' value='".$operario."'>
</td>
<td>
<input type='text' name='fechi' size='20' maxlength='15' value='".$fechainicio."'>
</td>
<td>
<input type='text' name='fecht' size='20' maxlength='15' value='".$fechafinal."'>
</td>
</tr>";
}
echo '</table>';
mysql_free_result($eje);
?>
</body>
</html>