Comunidad de diseño web y desarrollo en internet online

Pequeña consulta sql

Citar            
MensajeEscrito el 22 May 2009 02:15 pm
Es una consulta muy simple, me debo estar ahogando en un baso de agua, es para una aplicacion de facturacion, anda todo de maravilla, es un formulario con unos 20 campos, el tema es que deben ser modificados aveces, y uno o dos de los 20, mi problema es que cuando voy a modificar, los forms aparecen en blanco obviamente, y cuando modifico un o dos datos, en la base de datos me actualiza los 20, los que estabn en blanco tambien... entonces me sobreescribe lo que tenia cargado anteriormente por un espacio en blanco... como podria hacer para k el form solamente guarde los datos que estan escritos e ignore los que estan en blanco. O... la otra solucion, que cuando entro al form, ya aparezca con los valores que tiene en la db, en este caso deberia agregar algo mas, ya que el form te pide el numero de archivo que vas a modificar, no se si me explico, es un form neutro, al k insertandole un numero, indicas donde va a guardarse en la db. Dejo el codigo, desde ya mil gracias! :) :D

Codigo HTML

Código :

<form name="ordencompra" action="agregar_items.php" method="POST" style="word-spacing: 0; margin-top: 0; margin-bottom: 0">
<div align="center">
   <table border="1" width="21%" background="bg_header.jpg">
      <tr>
         <td background="bullet2.gif">
         <p align="center"><font color="#0000FF" face="Sylfaen">AGREGAR ITEM A O.C :</font></td>
      </tr>
      <tr>
         <td background="bullet3.gif">
         <p align="center"> <input name="n_oc"></td>
      </tr>
   </table>
</div>
<div align="center">
<table border="1" width="564" bordercolorlight="#99CCFF" bordercolordark="#A7DDE9" bgcolor="#FFFFFF" height="415" cellspacing="0" cellpadding="0" bordercolor="#A7DDE9">
   <tr>
      <td align="center" background="bg_header.jpg">
      <p style="margin-top: 0; margin-bottom: 0">
      <font face="Sylfaen" size="2">Numero de Item: </font> </td>
      <td align="center" background="bg_header.jpg">
      <p style="margin-top: 0; margin-bottom: 0">
      <font face="Sylfaen" size="2">Descripcion:</font></td>
      <td align="center" background="bg_header.jpg">
      <p style="margin-top: 0; margin-bottom: 0">
      <font face="Sylfaen" size="2">Precio Unitario: </font> </td>
      <td align="center" background="bg_header.jpg">
      <p style="margin-top: 0; margin-bottom: 0">
      <font face="Sylfaen" size="2">Cantidad Pendiente: </font> </td>
      <td align="center" background="bg_header.jpg">
      <p style="margin-top: 0; margin-bottom: 0">
      <font face="Sylfaen" size="2">Cantidad Entregada:</font></td>
      <td align="center" height="38" background="bg_header.jpg">
      <font face="Sylfaen" size="2">Demora de Entrega:</font></td>
      <td align="center" height="38" bgcolor="#808080" background="bg_header.jpg">
      <font face="Sylfaen" size="2">Agregar Remito</font></td>
   </tr>
   <tr>
      <td align="center" background="bullet2.gif"> 
      <p align="center" style="margin-top: 0; margin-bottom: 0"><i>
      <font color="#FF0000">
      <input type="text" name="n_item_1" size="7" value="01"></font></i></td>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> 
      <input type="text" name="descripcion_1" size="19"></td>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> 
      <input type="text" name="precio_unitario_1" size="8"></td>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <input type="text" name="cant_pendiente_1" size="8"></td>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <input type="text" name="cant_entreg_1" size="8"></td>
      <td align="center" height="25" background="bullet2.gif">
      <input type="text" name="demora_entreg_1" size="12"></td>
      <td align="center" height="25" bgcolor="#808080" background="bullet2.gif">
      <a href="../remito/remito-item1/carga_items.php">
      <img border="0" src="icon-16-editadd.png" width="18" height="16"></a></td>
   </tr>
   <tr>
      <td align="center" background="bullet3.gif"> 
      <p align="center" style="margin-top: 0; margin-bottom: 0"><i>
      <font color="#FF0000">
      <input type="text" name="n_item_2" size="7" value="02"></font></i></td>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> 
      <input type="text" name="descripcion_2" size="19"></td>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> 
      <input type="text" name="precio_unitario_2" size="8"></td>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <input type="text" name="cant_pendiente_2" size="8"></td>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <input type="text" name="cant_entreg_2" size="8"></td>
      <td align="center" height="24" background="bullet3.gif">
      <input type="text" name="demora_entreg_2" size="12"></td>
      <td align="center" height="24" background="bullet3.gif">
      <a href="../remito/remito-item2/carga_items.php">
      <img border="0" src="icon-16-editadd.png" width="18" height="16"></a></td>
   </tr>
   <tr>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <i><font color="#FF0000">
      <input type="text" name="n_item_3" size="7" value="03"></font></i></td>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> 
      <input type="text" name="descripcion_3" size="19"></td>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> 
      <input type="text" name="precio_unitario_3" size="8"></td>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <input type="text" name="cant_pendiente_3" size="8"></td>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <input type="text" name="cant_entreg_3" size="8"></td>
      <td align="center" height="26" background="bullet2.gif">
      <input type="text" name="demora_entreg_3" size="12"></td>
      <td align="center" height="26" bgcolor="#808080" background="bullet2.gif">
      <a href="../remito/remito-item3/carga_items.php">
      <img border="0" src="icon-16-editadd.png" width="18" height="16"></a></td>
   </tr>
   <tr>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <i><font color="#FF0000">
      <input type="text" name="n_item_4" size="7" value="04"></font></i></td>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> 
      <input type="text" name="descripcion_4" size="19"></td>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> 
      <input type="text" name="precio_unitario_4" size="8"></td>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <input type="text" name="cant_pendiente_4" size="8"></td>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <input type="text" name="cant_entreg_4" size="8"></td>
      <td align="center" height="25" background="bullet3.gif">
      <input type="text" name="demora_entreg_4" size="12"></td>
      <td align="center" height="25" background="bullet3.gif">
      <a href="../remito/remito-item4/carga_items.php">
      <img border="0" src="icon-16-editadd.png" width="18" height="16"></a></td>
   </tr>
   <tr>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <i><font color="#FF0000">
      <input type="text" name="n_item_5" size="7" value="05"></font></i></td>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> 
      <input type="text" name="descripcion_5" size="19"></td>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> 
      <input type="text" name="precio_unitario_5" size="8"></td>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <input type="text" name="cant_pendiente_5" size="8"></td>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <input type="text" name="cant_entreg_5" size="8"></td>
      <td align="center" height="25" background="bullet2.gif">
      <input type="text" name="demora_entreg_5" size="12"></td>
      <td align="center" height="25" bgcolor="#808080" background="bullet2.gif">
      <a href="../remito/remito-item5/carga_items.php">
      <img border="0" src="icon-16-editadd.png" width="18" height="16"></a></td>
   </tr>
   <tr>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <i><font color="#FF0000">
      <input type="text" name="n_item_6" size="7" value="06"></font></i></td>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> 
      <input type="text" name="descripcion_6" size="19"></td>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> 
      <input type="text" name="precio_unitario_6" size="8"></td>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <input type="text" name="cant_pendiente_6" size="8"></td>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <input type="text" name="cant_entreg_6" size="8"></td>
      <td align="center" height="25" background="bullet3.gif">
      <input type="text" name="demora_entreg_6" size="12"></td>
      <td align="center" height="25" background="bullet3.gif">
      <a href="../remito/remito-item6/carga_items.php">
      <img border="0" src="icon-16-editadd.png" width="18" height="16"></a></td>
   </tr>
   <tr>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <i><font color="#FF0000">
      <input type="text" name="n_item_7" size="7" value="07"></font></i></td>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> 
      <input type="text" name="descripcion_7" size="19"></td>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> 
      <input type="text" name="precio_unitario_7" size="8"></td>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <input type="text" name="cant_pendiente_7" size="8"></td>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <input type="text" name="cant_entreg_7" size="8"></td>
      <td align="center" height="25" background="bullet2.gif">
      <input type="text" name="demora_entreg_7" size="12"></td>
      <td align="center" height="25" bgcolor="#808080" background="bullet2.gif">
      <a href="../remito/remito-item7/carga_items.php">
      <img border="0" src="icon-16-editadd.png" width="18" height="16"></a></td>
   </tr>
   <tr>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <i><font color="#FF0000">
      <input type="text" name="n_item_8" size="7" value="08"></font></i></td>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> 
      <input type="text" name="descripcion_8" size="19"></td>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> 
      <input type="text" name="precio_unitario_8" size="8"></td>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <input type="text" name="cant_pendiente_8" size="8"></td>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <input type="text" name="cant_entreg_8" size="8"></td>
      <td align="center" height="24" background="bullet3.gif">
      <input type="text" name="demora_entreg_8" size="12"></td>
      <td align="center" height="24" background="bullet3.gif">
      <a href="../remito/remito-item8/carga_items.php">
      <img border="0" src="icon-16-editadd.png" width="18" height="16"></a></td>
   </tr>
   <tr>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <i><font color="#FF0000">
      <input type="text" name="n_item_9" size="7" value="09"></font></i></td>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> 
      <input type="text" name="descripcion_9" size="19"></td>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> 
      <input type="text" name="precio_unitario_9" size="8"></td>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <input type="text" name="cant_pendiente_9" size="8"></td>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <input type="text" name="cant_entreg_9" size="8"></td>
      <td align="center" height="26" background="bullet2.gif">
      <input type="text" name="demora_entreg_9" size="12"></td>
      <td align="center" height="26" bgcolor="#808080" background="bullet2.gif">
      <a href="../remito/remito-item9/carga_items.php">
      <img border="0" src="icon-16-editadd.png" width="18" height="16"></a></td>
   </tr>
   <tr>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <i><font color="#FF0000">
      <input type="text" name="n_item_10" size="7" value="10"></font></i></td>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> 
      <input type="text" name="descripcion_10" size="19"></td>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> 
      <input type="text" name="precio_unitario_10" size="8"></td>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <input type="text" name="cant_pendiente_10" size="8"></td>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <input type="text" name="cant_entreg_10" size="8"></td>
      <td align="center" height="25" background="bullet3.gif">
      <input type="text" name="demora_entreg_10" size="12"></td>
      <td align="center" height="25" background="bullet3.gif">
      <a href="../remito/remito-item10/carga_items.php">
      <img border="0" src="icon-16-editadd.png" width="18" height="16"></a></td>
   </tr>
   <tr>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <i><font color="#FF0000">
      <input type="text" name="n_item_11" size="7" value="11"></font></i></td>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> 
      <input type="text" name="descripcion_11" size="19"></td>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> 
      <input type="text" name="precio_unitario_11" size="8"></td>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <input type="text" name="cant_pendiente_11" size="8"></td>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <input type="text" name="cant_entreg_11" size="8"></td>
      <td align="center" height="25" background="bullet2.gif">
      <input type="text" name="demora_entreg_11" size="12"></td>
      <td align="center" height="25" bgcolor="#808080" background="bullet2.gif">
      <a href="../remito/remito-item11">
      <img border="0" src="icon-16-editadd.png" width="18" height="16"></a></td>
   </tr>
   <tr>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <i><font color="#FF0000">
      <input type="text" name="n_item_12" size="7" value="12"></font></i></td>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> 
      <input type="text" name="descripcion_12" size="19"></td>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> 
      <input type="text" name="precio_unitario_12" size="8"></td>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <input type="text" name="cant_pendiente_12" size="8"></td>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <input type="text" name="cant_entreg_12" size="8"></td>
      <td align="center" height="25" background="bullet3.gif">
      <input type="text" name="demora_entreg_12" size="12"></td>
      <td align="center" height="25" background="bullet3.gif">
      <a href="../remito/remito-item12/carga_items.php">
      <img border="0" src="icon-16-editadd.png" width="18" height="16"></a></td>
   </tr>
   <tr>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <i><font color="#FF0000">
      <input type="text" name="n_item_13" size="7" value="13"></font></i></td>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> 
      <input type="text" name="descripcion_13" size="19"></td>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> 
      <input type="text" name="precio_unitario_13" size="8"></td>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <input type="text" name="cant_pendiente_13" size="8"></td>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <input type="text" name="cant_entreg_13" size="8"></td>
      <td align="center" height="25" background="bullet2.gif">
      <input type="text" name="demora_entreg_13" size="12"></td>
      <td align="center" height="25" bgcolor="#808080" background="bullet2.gif">
      <a href="../remito/remito-item13/carga_items.php">
      <img border="0" src="icon-16-editadd.png" width="18" height="16"></a></td>
   </tr>
   <tr>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <i><font color="#FF0000">
      <input type="text" name="n_item_14" size="7" value="14"></font></i></td>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> 
      <input type="text" name="descripcion_14" size="19"></td>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> 
      <input type="text" name="precio_unitario_14" size="8"></td>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <input type="text" name="cant_pendiente_14" size="8"></td>
      <td align="center" background="bullet3.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <input type="text" name="cant_entreg_14" size="8"></td>
      <td align="center" height="24" background="bullet3.gif">
      <input type="text" name="demora_entreg_14" size="12"></td>
      <td align="center" height="24" background="bullet3.gif">
      <a href="../remito/remito-item14/carga_items.php">
      <img border="0" src="icon-16-editadd.png" width="18" height="16"></a></td>
   </tr>
   <tr>
      <td width="75" align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <i><font color="#FF0000">
      <input type="text" name="n_item_15" size="7" value="15"></font></i></td>
      <td width="141" align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> 
      <input type="text" name="descripcion_14" size="19"></td>
      <td align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> 
      <input type="text" name="precio_unitario_15" size="8"></td>
      <td width="64" align="center" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <input type="text" name="cant_pendiente_15" size="8"></td>
      <td align="center" width="64" background="bullet2.gif"> 
      <p style="margin-top: 0; margin-bottom: 0"> <input type="text" name="cant_entreg_15" size="8"></td>
      <td align="center" height="26" width="92" background="bullet2.gif">
      <p style="margin-top: 0; margin-bottom: 0">
      <input type="text" name="demora_entreg_15" size="12"></td>
      <td align="center" height="26" width="43" bgcolor="#808080" background="bullet2.gif">
      <p style="margin-top: 0; margin-bottom: 0">
      <a href="../remito/remito-item15/carga_items.php">
      <img border="0" src="icon-16-editadd.png" width="18" height="16"></a></td>
   </tr>
</table>
<p style="margin-top: 0; margin-bottom: 0">
<input type="submit" value="Actualizar"></div>
</form>



Codigo PHP:

Código :

<?php

        $link = mysql_connect("localhost","root","pass");
        mysql_select_db("sys_fluo",$link);

   //Aca ingreso el Query para realizar el update de datos

   mysql_query("UPDATE orden_compra_cliente 
   SET n_item_1='{$_POST['n_item_1']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET descripcion_1='{$_POST['descripcion_1']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET precio_unitario_1='{$_POST['precio_unitario_1']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET cant_pendiente_1='{$_POST['cant_pendiente_1']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET cant_entreg_1='{$_POST['cant_entreg_1']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET remito_1='{$_POST['remito_1']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET fecha_remito_1='{$_POST['fecha_remito_1']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET factura_1='{$_POST['factura_1']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET fecha_fact_1='{$_POST['fecha_fact_1']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET import_total_siva_1='{$_POST['import_total_siva_1']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET demora_entreg_1='{$_POST['demora_entreg_1']}' 
   WHERE n_oc='{$_POST['n_oc']}'");


//Aca ahora para el item numero 2


   mysql_query("UPDATE orden_compra_cliente 
   SET descripcion_2='{$_POST['descripcion_2']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET precio_unitario_2='{$_POST['precio_unitario_2']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET cant_pendiente_2='{$_POST['cant_pendiente_2']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET cant_entreg_2='{$_POST['cant_entreg_2']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET remito_2='{$_POST['remito_2']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET fecha_remito_2='{$_POST['fecha_remito_2']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET factura_2='{$_POST['factura_2']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET fecha_fact_2='{$_POST['fecha_fact_2']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET import_total_siva_2='{$_POST['import_total_siva_2']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET demora_entreg_2='{$_POST['demora_entreg_2']}' 
   WHERE n_oc='{$_POST['n_oc']}'");


//Aca ahora para el item numero 3


   mysql_query("UPDATE orden_compra_cliente 
   SET descripcion_3='{$_POST['descripcion_3']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET precio_unitario_3='{$_POST['precio_unitario_3']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET cant_pendiente_3='{$_POST['cant_pendiente_3']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET cant_entreg_3='{$_POST['cant_entreg_3']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET remito_3='{$_POST['remito_3']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET fecha_remito_3='{$_POST['fecha_remito_3']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET factura_3='{$_POST['factura_3']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET fecha_fact_3='{$_POST['fecha_fact_3']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET import_total_siva_3='{$_POST['import_total_siva_3']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET demora_entreg_3='{$_POST['demora_entreg_3']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

//Aca ahora para el item numero 4


   mysql_query("UPDATE orden_compra_cliente 
   SET descripcion_4='{$_POST['descripcion_4']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET precio_unitario_4='{$_POST['precio_unitario_4']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET cant_pendiente_4='{$_POST['cant_pendiente_4']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET cant_entreg_4='{$_POST['cant_entreg_4']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET remito_4='{$_POST['remito_4']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET fecha_remito_4='{$_POST['fecha_remito_4']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET factura_4='{$_POST['factura_4']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET fecha_fact_4='{$_POST['fecha_fact_4']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET import_total_siva_4='{$_POST['import_total_siva_4']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET demora_entreg_4='{$_POST['demora_entreg_4']}' 
   WHERE n_oc='{$_POST['n_oc']}'");



//Aca ahora para el item numero 5


   mysql_query("UPDATE orden_compra_cliente 
   SET descripcion_5='{$_POST['descripcion_5']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET precio_unitario_5='{$_POST['precio_unitario_5']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET cant_pendiente_5='{$_POST['cant_pendiente_5']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET cant_entreg_5='{$_POST['cant_entreg_5']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET remito_5='{$_POST['remito_5']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET fecha_remito_5='{$_POST['fecha_remito_5']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET factura_5='{$_POST['factura_5']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET fecha_fact_5='{$_POST['fecha_fact_5']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET import_total_siva_5='{$_POST['import_total_siva_5']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET demora_entreg_5='{$_POST['demora_entreg_5']}' 
   WHERE n_oc='{$_POST['n_oc']}'");



//Aca ahora para el item numero 6



   mysql_query("UPDATE orden_compra_cliente 
   SET descripcion_6='{$_POST['descripcion_6']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET precio_unitario_6='{$_POST['precio_unitario_6']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET cant_pendiente_6='{$_POST['cant_pendiente_6']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET cant_entreg_6='{$_POST['cant_entreg_6']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET remito_6='{$_POST['remito_6']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET fecha_remito_6='{$_POST['fecha_remito_6']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET factura_6='{$_POST['factura_6']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET fecha_fact_6='{$_POST['fecha_fact_6']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET import_total_siva_6='{$_POST['import_total_siva_6']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET demora_entreg_6='{$_POST['demora_entreg_6']}' 
   WHERE n_oc='{$_POST['n_oc']}'");


//Aca ahora para el item numero 7


   mysql_query("UPDATE orden_compra_cliente 
   SET descripcion_7='{$_POST['descripcion_7']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET precio_unitario_7='{$_POST['precio_unitario_7']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET cant_pendiente_7='{$_POST['cant_pendiente_7']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET cant_entreg_7='{$_POST['cant_entreg_7']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET remito_7='{$_POST['remito_7']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET fecha_remito_7='{$_POST['fecha_remito_7']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET factura_7='{$_POST['factura_7']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET fecha_fact_7='{$_POST['fecha_fact_7']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET import_total_siva_7='{$_POST['import_total_siva_7']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET demora_entreg_7='{$_POST['demora_entreg_7']}' 
   WHERE n_oc='{$_POST['n_oc']}'");



//Aca ahora para el item numero 8


   mysql_query("UPDATE orden_compra_cliente 
   SET descripcion_8='{$_POST['descripcion_8']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET precio_unitario_8='{$_POST['precio_unitario_8']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET cant_pendiente_8='{$_POST['cant_pendiente_8']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET cant_entreg_8='{$_POST['cant_entreg_8']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET remito_8='{$_POST['remito_8']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET fecha_remito_8='{$_POST['fecha_remito_8']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET factura_8='{$_POST['factura_8']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET fecha_fact_8='{$_POST['fecha_fact_8']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET import_total_siva_8='{$_POST['import_total_siva_8']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET demora_entreg_8='{$_POST['demora_entreg_8']}' 
   WHERE n_oc='{$_POST['n_oc']}'");




//Aca ahora para el item numero 9



   mysql_query("UPDATE orden_compra_cliente 
   SET descripcion_9='{$_POST['descripcion_9']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET precio_unitario_9='{$_POST['precio_unitario_9']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET cant_pendiente_9='{$_POST['cant_pendiente_9']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET cant_entreg_9='{$_POST['cant_entreg_9']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET remito_9='{$_POST['remito_9']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET fecha_remito_9='{$_POST['fecha_remito_9']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET factura_9='{$_POST['factura_9']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET fecha_fact_9='{$_POST['fecha_fact_9']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET import_total_siva_9='{$_POST['import_total_siva_9']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET demora_entreg_9='{$_POST['demora_entreg_9']}' 
   WHERE n_oc='{$_POST['n_oc']}'");



//Aca ahora para el item numero 10



   mysql_query("UPDATE orden_compra_cliente 
   SET descripcion_10='{$_POST['descripcion_10']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET precio_unitario_10='{$_POST['precio_unitario_10']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET cant_pendiente_10='{$_POST['cant_pendiente_10']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET cant_entreg_10='{$_POST['cant_entreg_10']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET remito_10='{$_POST['remito_10']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET fecha_remito_10='{$_POST['fecha_remito_10']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET factura_10='{$_POST['factura_10']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET fecha_fact_10='{$_POST['fecha_fact_10']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET import_total_siva_10='{$_POST['import_total_siva_10']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET demora_entreg_10='{$_POST['demora_entreg_10']}' 
   WHERE n_oc='{$_POST['n_oc']}'");



//Aca ahora para el item numero 11


   mysql_query("UPDATE orden_compra_cliente 
   SET descripcion_11='{$_POST['descripcion_11']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET precio_unitario_11='{$_POST['precio_unitario_11']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET cant_pendiente_11='{$_POST['cant_pendiente_11']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET cant_entreg_11='{$_POST['cant_entreg_11']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET remito_11='{$_POST['remito_11']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET fecha_remito_11='{$_POST['fecha_remito_11']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET factura_11='{$_POST['factura_11']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET fecha_fact_11='{$_POST['fecha_fact_11']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET import_total_siva_11='{$_POST['import_total_siva_11']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET demora_entreg_11='{$_POST['demora_entreg_11']}' 
   WHERE n_oc='{$_POST['n_oc']}'");




//Aca ahora para el item numero 12


   mysql_query("UPDATE orden_compra_cliente 
   SET descripcion_12='{$_POST['descripcion_12']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET precio_unitario_12='{$_POST['precio_unitario_12']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET cant_pendiente_12='{$_POST['cant_pendiente_12']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET cant_entreg_12='{$_POST['cant_entreg_12']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET remito_12='{$_POST['remito_12']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET fecha_remito_12='{$_POST['fecha_remito_12']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET factura_12='{$_POST['factura_12']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET fecha_fact_12='{$_POST['fecha_fact_12']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET import_total_siva_12='{$_POST['import_total_siva_12']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET demora_entreg_12='{$_POST['demora_entreg_12']}' 
   WHERE n_oc='{$_POST['n_oc']}'");





//Aca ahora para el item numero 13



   mysql_query("UPDATE orden_compra_cliente 
   SET descripcion_13='{$_POST['descripcion_13']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET precio_unitario_13='{$_POST['precio_unitario_13']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET cant_pendiente_13='{$_POST['cant_pendiente_13']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET cant_entreg_13='{$_POST['cant_entreg_13']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET remito_13='{$_POST['remito_13']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET fecha_remito_13='{$_POST['fecha_remito_13']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET factura_13='{$_POST['factura_13']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET fecha_fact_13='{$_POST['fecha_fact_13']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET import_total_siva_13='{$_POST['import_total_siva_13']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET demora_entreg_13='{$_POST['demora_entreg_13']}' 
   WHERE n_oc='{$_POST['n_oc']}'");



//Aca ahora para el item numero 14



   mysql_query("UPDATE orden_compra_cliente 
   SET descripcion_14='{$_POST['descripcion_14']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET precio_unitario_14='{$_POST['precio_unitario_14']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET cant_pendiente_14='{$_POST['cant_pendiente_14']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET cant_entreg_14='{$_POST['cant_entreg_14']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET remito_14='{$_POST['remito_14']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET fecha_remito_14='{$_POST['fecha_remito_14']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET factura_14='{$_POST['factura_14']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET fecha_fact_14='{$_POST['fecha_fact_14']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET import_total_siva_14='{$_POST['import_total_siva_14']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET demora_entreg_14='{$_POST['demora_entreg_14']}' 
   WHERE n_oc='{$_POST['n_oc']}'");



//Aca ahora para el item numero 15




   mysql_query("UPDATE orden_compra_cliente 
   SET descripcion_15='{$_POST['descripcion_15']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET precio_unitario_15='{$_POST['precio_unitario_15']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET cant_pendiente_15='{$_POST['cant_pendiente_15']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET cant_entreg_15='{$_POST['cant_entreg_15']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET remito_15='{$_POST['remito_15']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET fecha_remito_15='{$_POST['fecha_remito_15']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET factura_15='{$_POST['factura_15']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET fecha_fact_15='{$_POST['fecha_fact_15']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET import_total_siva_15='{$_POST['import_total_siva_15']}' 
   WHERE n_oc='{$_POST['n_oc']}'");

   mysql_query("UPDATE orden_compra_cliente 
   SET demora_entreg_15='{$_POST['demora_entreg_15']}' 
   WHERE n_oc='{$_POST['n_oc']}'");




// Ahora comprobaremos que todo ha ido correctamente
        $my_error = mysql_error($link);

        if(!empty($my_error)) {

            echo "Ha habido un error al insertar los valores. $my_error"; 

        } else {

            echo "Los datos han sido introducidos satisfactoriamente";

        }

?>

Por vakeronqn

5 de clabLevel



 

firefox
Citar            
MensajeEscrito el 22 May 2009 05:41 pm
Me respondo a mi mismo por si alguien necesita el dato en el futuro, la manera de que el campo del formulario que no escribamos no sea enviado como dato a la db, y nos sobreescriba el dato cargado anteriormente es el siguiente:

if($_POST['campo']){
$sSQL=CONSULTA SQL'";
mysql_db_query("ej_cuenta",$sSQL);
}

Esto en un ejemplo podria verse asi:
Supongamos que queremos actualizar un precio de un item, la linea del script php quedaria asi:

if($_POST['precio']){
mysql_query("UPDATE mi_base_de_datos
SETprecio='{$_POST['precio']}'
WHERE item='{$_POST['item']}'");
}

Con estas lineas indicamos que lo que figure en el campo Precio del formulario sea actualizado en la base de datos, y con las lineas extra if($_POST['precio']){} Indicamos que si el campo esta en blanco, no guarde datos en la base de datos. Les dejo un ejemplo de html de form que va con este ej para que les cierre mas.

Precio:</td> <input type="text" name="precio"></td>

Saludos!

Por vakeronqn

5 de clabLevel



 

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.