Ver Mensaje Individual
  #4 (permalink)  
Antiguo 28/03/2007, 09:16
Avatar de alllebor
alllebor
 
Fecha de Ingreso: septiembre-2006
Mensajes: 295
Antigüedad: 17 años, 7 meses
Puntos: 1
Re: Problema al actualizar los datos!!

Bueno aqui os pongo el codigo del formulario donde carga el registro a modificar.


Código HTML:
<form  method="post" action="actualizar.php" enctype="multipart/form-data" al>
           
            <table align="center">
			         <tr>
                  <td width="95"><div align="right"></div></td>
                  <td width="567"><input name="id" type="hidden" id="id" value="<? echo $id;?> " size="15" maxlength="15" /></td>
                </tr>
                <tr>
                  <td><div align="right"><strong>C&oacute;digo</strong>:</div></td>
                  <td width="567"><input value="<? echo $referencia;?>" name="codigo" type="text" id="codigo" size="15" maxlength="15" /></td>
                </tr>
				<tr>
                  <td height="30"><div align="right"><strong>Tipo:</strong></div></td>
                  <td width="567">
				  <?php 

            
        //$query = "SELECT pueblo FROM poblacion "; 
        $restipo = mysql_query( "SELECT tipo FROM tipo "); 
       
         
        echo "<select class='combo' id='tipo' name='tipo' onChange='cargaContenido(4)'>";
		
        echo "<option selected value=".$tipo.">".$tipo."</option>"; 
        while($reg = mysql_fetch_array($restipo)) 
        { 
            echo "<option value='".$reg[0]."'>".$reg[0]."</option>"; 
        } 
         
        echo "</select>"; 
	mysql_free_result($restipo); 
    
    
?> </td>
              </tr>
				
		 <tr>
          <td><div align="right"><strong>Precio:</strong></div></td>
          <td width="567"><input name="precio" value="<? echo $precio;?>" type="text" id="precio" size="15" maxlength="8" /></td>
        </tr>
		<tr>
                  <td height="30"><div align="right"><strong>Poblaci&oacute;n:</strong></div></td>
                  <td width="567">
				  <?php 
            
        //$query = "SELECT pueblo FROM poblacion "; 
        $res = mysql_query( "SELECT pueblo FROM poblacion "); 
       
         
        echo "<select class='combo' id='poblacion' name='poblacion' onChange='cargaContenido(4)'>"; 
        echo "<option selected value=".$poblacion.">".$poblacion."</option>"; 
        while($reg = mysql_fetch_array($res)) 
        { 
            echo "<option value='".$reg[0]."'>".$reg[0]."</option>"; 
        } 
         
        echo "</select>"; 
	mysql_free_result($res); 
    mysql_close($conect); 
    
?> </td>
              </tr>
        <tr>
          <td height="54"><div align="right"><strong>Descripci&oacute;n:</strong></div></td>
          <td><textarea id="cuerpo" name="cuerpo" cols="70" rows="6" ><? echo $descripcion;?></textarea></td>
        </tr>
</table>
 <input type="submit" name="accion" value="Actualizar"/>
		</p>
      </div>
	   </form> 
Solo deciros que el problema me da con los select que se generan apartir de una consulta. Los selects poblacion y tipo.

Muchas gracias!!
__________________
Quien no me pregunta no se entera!!