Ver Mensaje Individual
  #3 (permalink)  
Antiguo 03/06/2004, 03:29
DEL_DAN
 
Fecha de Ingreso: noviembre-2003
Ubicación: Barcelona
Mensajes: 181
Antigüedad: 20 años, 6 meses
Puntos: 0
este es el código.
el formulario este

lo que pretendo es que cod y descrip / cod1 y descrip1 / etc...
que escoja un codigo en $cod, y en $descrip me traiga la descripción ambos en la misma base de datos..


espero haberme explicado


creo que esto biene a ser lo tipico de un formulario que escojes el pais y te salen las provincias automaticamente.


gracias

un salduo
Dan
__________________________________________________ _________
Código HTML:
<form method="post" name="form1" action="<?php echo $editFormAction; ?>">
  <p align="center"><strong><font size="4" face="Verdana, Arial, Helvetica, sans-serif">Planificaci&oacute;n 
    SARRAL P41 L&Iacute;NEA5</font></strong></p>
  <table width="75%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr bgcolor="#0072BC"> 
      <td> <div align="right"><font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif">semana:</font></div></td>
      
            <?php
do {  
?>
            <option value="<?php echo $row_ref_p79['codigo']?>"><?php echo $row_ref_p79['codigo']?></option>
            <?php
} while ($row_ref_p79 = mysql_fetch_assoc($ref_p79));
  $rows = mysql_num_rows($ref_p79);
  if($rows > 0) {
      mysql_data_seek($ref_p79, 0);
	  $row_ref_p79 = mysql_fetch_assoc($ref_p79);
  }
?>
          </select>
        </div></td>
      <td bgcolor="#0072BC"> <div align="center"> 
          <select name="descrip">
            <?php
do {  
?>
            <option value="<?php echo $row_ref_p79['Descripcion']?>"><?php echo $row_ref_p79['Descripcion']?></option>
            <?php
} while ($row_ref_p79 = mysql_fetch_assoc($ref_p79));
  $rows = mysql_num_rows($ref_p79);
  if($rows > 0) {
      mysql_data_seek($ref_p79, 0);
	  $row_ref_p79 = mysql_fetch_assoc($ref_p79);
  }
?>
          </select>
        </div></td>
      <td bgcolor="#0072BC"> <div align="center"> 
          <input type="text" name="lunes" value="" size="10">
        </div></td>
      <td bgcolor="#0072BC"> <div align="center"> 
          <input type="text" name="martes" value="" size="10">
        </div></td>
      <td bgcolor="#0072BC"> <div align="center"> 
          <input type="text" name="miercoles" value="" size="10">
        </div></td>
      <td bgcolor="#0072BC"> <div align="center"> 
          <input type="text" name="jueves" value="" size="10">
        </div></td>
      <td bgcolor="#0072BC"> <div align="center"> 
          <input type="text" name="viernes" value="" size="10">
        </div></td>
      <td bgcolor="#0072BC"> <div align="center"> 
          <input type="text" name="sabado" value="" size="10">
        </div></td>
      <td bgcolor="#0072BC"> <div align="center"> 
          <input type="text" name="domingo" value="" size="10">
        </div></td>
    </tr>
    <tr> 
      <td bgcolor="#0072BC"> <div align="center"> 
          <select name="cod1" id="cod1">
            <?php
do {  
?>
            <option value="<?php echo $row_ref_p79['codigo']?>"><?php echo $row_ref_p79['codigo']?></option>
            <?php
} while ($row_ref_p79 = mysql_fetch_assoc($ref_p79));
  $rows = mysql_num_rows($ref_p79);
  if($rows > 0) {
      mysql_data_seek($ref_p79, 0);
	  $row_ref_p79 = mysql_fetch_assoc($ref_p79);
  }
?>
          </select>
        </div></td>
      <td bgcolor="#0072BC"> <div align="center"> 
          <select name="descrip1" id="descrip1">
            <?php
do {  
?>
            <option value="<?php echo $row_ref_p79['Descripcion']?>"><?php echo $row_ref_p79['Descripcion']?></option>
            <?php
} while ($row_ref_p79 = mysql_fetch_assoc($ref_p79));
  $rows = mysql_num_rows($ref_p79);
  if($rows > 0) {
      mysql_data_seek($ref_p79, 0);
	  $row_ref_p79 = mysql_fetch_assoc($ref_p79);
  }
?>
          </select>
        </div></td>
      <td bgcolor="#0072BC"> <div align="center"> 
          <input type="text" name="lunes1" value="" size="10">
        </div></td>
      <td bgcolor="#0072BC"> <div align="center"> 
          <input type="text" name="martes1" value="" size="10">
        </div></td>
      <td bgcolor="#0072BC"> <div align="center"> 
          <input type="text" name="miercoles1" value="" size="10">
        </div></td>
      <td bgcolor="#0072BC"> <div align="center"> 
          <input type="text" name="jueves1" value="" size="10">
        </div></td>
      <td bgcolor="#0072BC"> <div align="center"> 
          <input type="text" name="viernes1" value="" size="10">
        </div></td>
      <td bgcolor="#0072BC"> <div align="center"> 
          <input type="text" name="sabado1" value="" size="10">
        </div></td>
      <td bgcolor="#0072BC"> <div align="center"> 
          <input type="text" name="domingo1" value="" size="10">
        </div></td>
    </tr>
    <tr> 
      <td bgcolor="#0072BC"> <div align="center"> 
          <select name="cod2" id="cod2">
            <?php
do {  
?>
            <option value="<?php echo $row_ref_p79['codigo']?>"><?php echo $row_ref_p79['codigo']?></option>
            <?php
} while ($row_ref_p79 = mysql_fetch_assoc($ref_p79));
  $rows = mysql_num_rows($ref_p79);
  if($rows > 0) {
      mysql_data_seek($ref_p79, 0);
	  $row_ref_p79 = mysql_fetch_assoc($ref_p79);
  }
?>
          </select>
        </div></td>
      <td bgcolor="#0072BC"> <div align="center"> 
          <select name="descrip2" id="descrip2">
            <?php
do {  
?>
            <option value="<?php echo $row_ref_p79['Descripcion']?>"><?php echo $row_ref_p79['Descripcion']?></option>
            <?php
} while ($row_ref_p79 = mysql_fetch_assoc($ref_p79));
  $rows = mysql_num_rows($ref_p79);
  if($rows > 0) {
      mysql_data_seek($ref_p79, 0);
	  $row_ref_p79 = mysql_fetch_assoc($ref_p79);
  }
?>
          </select>
        </div></td>
      <td bgcolor="#0072BC"> <div align="center"> 
          <input type="text" name="lunes2" value="" size="10">
        </div></td>
      <td bgcolor="#0072BC"> <div align="center"> 
          <input type="text" name="martes2" value="" size="10">
        </div></td>
      <td bgcolor="#0072BC"> <div align="center"> 
          <input type="text" name="miercoles2" value="" size="10">
        </div></td>
      <td bgcolor="#0072BC"> <div align="center"> 
          <input type="text" name="jueves2" value="" size="10">
        </div></td>
      <td bgcolor="#0072BC"> <div align="center"> 
          <input type="text" name="viernes2" value="" size="10">
        </div></td>
      <td bgcolor="#0072BC"> <div align="center"> 
          <input type="text" name="sabado2" value="" size="10">
        </div></td>
      <td bgcolor="#0072BC"> <div align="center"> 
          <input type="text" name="domingo2" value="" size="10">
        </div></td>
    </tr>
    <tr> 
      <td bgcolor="#0072BC"> <div align="center"> 
          <select name="cod3" id="cod3">
            <?php
do {  
?>
            <option value="<?php echo $row_ref_p79['codigo']?>"><?php echo $row_ref_p79['codigo']?></option>
            <?php
} while ($row_ref_p79 = mysql_fetch_assoc($ref_p79));
  $rows = mysql_num_rows($ref_p79);
  if($rows > 0) {
      mysql_data_seek($ref_p79, 0);
	  $row_ref_p79 = mysql_fetch_assoc($ref_p79);
  }
?>
  </table>
  <div align="center"> 
    <input name="submit" type="submit" value="Insertar">
    <input type="hidden" name="hora" value="">
    <input type="hidden" name="fecha" value="">
    <input type="hidden" name="MM_insert" value="form1">
  </div>
  </form> 
__________________________________________________ ______
__________________
___________________________

DEL_DAN