Ver Mensaje Individual
  #18 (permalink)  
Antiguo 28/03/2011, 12:02
Avatar de bUllan9ebrio
bUllan9ebrio
 
Fecha de Ingreso: enero-2011
Ubicación: Chile
Mensajes: 1.128
Antigüedad: 13 años, 3 meses
Puntos: 128
Respuesta: selcciono combo y paso a caja de texto

Ya compadre, si no te funciona esto, piensa en prenderle fuego al pc jejejeje


Código PHP:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <style type="text/css">
  6. <!--
  7. body {
  8. background-color: #CCCCCC;
  9. background-image: url();
  10. }
  11. body,td,th {
  12. color: #0000CC;
  13. }
  14. .Estilo3 {font-: 16px}
  15. .Estilo4 {color: #FF0000}
  16. -->
  17. </style>
  18. </head>
  19. <body>
  20. <form name="form" action="busca.php" method="post">
  21.     <?php
  22.         $conexion=mysql_connect("localhost","root","") or  die("Problemas en la conexion");
  23.         mysql_select_db("mtto",$conexion) or  die("Problemas en la selección de la base de datos");
  24.         $sql="SELECT * FROM maquina";
  25.         $result=mysql_query($sql);
  26.         echo'<select name="nombre_dado" id="nombre_dado" onchange="this.form.submit()">';
  27.                 while ($row=mysql_fetch_row($result))
  28.                 {
  29.                     $id=$row['id_maquina'];
  30.                     $nombre=$row['nombmaq'];
  31.                     echo "<option value=".$id.">".$nombre."</option>";
  32.                 }
  33.         echo "</select>
  34. </form>";
  35. $id=$_POST['id'];
  36. $sql1="select * from maquina where id='$id'";
  37. $eje=mysql_query($sql1);
  38. echo '<table border="1" cellspacing="1" cellpadding="1">
  39.         <tr>
  40.             <td bgcolor="#FFFFFF"><span class="Estilo4"><strong>&nbsp;Nombre de la maquina..</strong></span></TD>
  41.             <td bgcolor="#FFFFFF" class="Estilo4"><strong>&nbsp;tipo de mantto..&nbsp;</strong></TD>
  42.             <td bgcolor="#FFFFFF" class="Estilo4"><strong>&nbsp;operario a cargo..&nbsp;</strong></TD>
  43.             <td bgcolor="#FFFFFF" class="Estilo4"><strong>&nbsp;fecha inicio..&nbsp;</strong></TD>
  44.             <td bgcolor="#FFFFFF" class="Estilo4"><strong>&nbsp;fecha final..&nbsp;</strong></TD>
  45.         </tr>';
  46.         while($row = mysql_fetch_array($eje))
  47.         {
  48.             $nombre=$row["nombmaq"];
  49.             $tipo=$row["tipmtt"];
  50.             $operario=$row["operario"];
  51.             $fechainicio=$row["fechi"];
  52.             $fechafinal=$row["fecht"];
  53.         echo "<tr>
  54.                 <td>
  55.                     <input type='text' name='nombmaq' size='50' maxlength='30' value='".$nombre."'>
  56.                 </td>
  57.                 <td>
  58.                     <input type='text' name='tipmtt' size='20' maxlength='20' value='".$tipo."'>
  59.                 </td>
  60.                 <td>
  61.                     <input type='text' name='operario' size='20' maxlength='30' value='".$operario."'>
  62.                 </td>
  63.                 <td>
  64.                     <input type='text' name='fechi' size='20' maxlength='15' value='".$fechainicio."'>
  65.                 </td>
  66.                 <td>
  67.                     <input type='text' name='fecht' size='20' maxlength='15' value='".$fechafinal."'>
  68.                 </td>
  69.             </tr>";
  70. }
  71. echo '</table>';
  72. ?>
  73. </body>
  74. </html>

pd :Aprende a mantener el orden y mejora tu sintaxis
__________________
Si no vivimos como pensamos, pronto empezaremos a pensar como vivimos.
Más vale un Gracias sincero, que un número que aumente "popularidad" ¬¬°

Universidad de chile, campeón