Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/04/2008, 09:55
invenible
 
Fecha de Ingreso: marzo-2008
Mensajes: 77
Antigüedad: 16 años, 10 meses
Puntos: 0
Pregunta ayuda update desde una opcion de combo

ayuda tengo el siguiente codigo

lo ke kiero hacer es un update al seleccionar una opcion del combo y darle click al boton

Código PHP:
<html>
 <body>
 <?
   $db 
mysql_connect("localhost","root"); 
    
mysql_select_db("adelantos",$db); 
    
?>
 <form action="updatedecombo.php" method="post">
            <td colspan="2">Motivo: <br>
               <?php
            $result 
mysql_query('SELECT txt_query FROM adelantos');
            echo
"<select name='motivo[]'>";
            while(
$rowmarcamysql_fetch_array($result))
            { 
                echo
"<OPTION value=$rowmarca[txt_query]>".$rowmarca[txt_query]."</option>"
            } 
            echo
"</select>"
            
?>
            
    
   </td>
   <td colspan="2"><input name="enviar" type="submit" value="Enviar"></td>
    </form>
                <?php
$id 
$_POST['motivo'];
    
$res mysql_query("UPDATE adelantos SET cambio='$motivo' WHERE id_query=1");
     
     
?>
    
    </body>
    </html>
si me despliega el combo pero al seleccionar un opcion y dar submit no me hace el update no se mi me hace falta algo
de antemano gracias y saludos