tengo un problema con la modificación de una columna en una tabla mysql
la verdad no soy muy experto
guardan todos menos la referencia quien me pueda ayudar mil gracias
este es el formulario
Código HTML:
Ver original
<h3> <form name="FormIngreso" action="../logica/LogicaActualizar.php" method="post" onSubmit="return validateForm()" enctype="multipart/form-data"> <?php require_once("conexion.php"); $sql="select * from codigos where referencia=".$_GET["referencia"].""; $res=mysql_query($sql,$con); ?> <?php if ($reg=mysql_fetch_array($res)) { ?> <table width="65%" border="0" align="center"> <tr> <input type="text" name="TB_Ref" id="TB_Ref" value="<?php echo $reg["referencia"];?>"> </tr> <tr> <input type="text" name="TB_Tall" id="TB_Tall" maxlength="5" value="<?php echo $reg["talla"];?>" > </tr> <tr> <input type="text" name="TB_Mar" id="TB_Mar" value="<?php echo $reg["marca"];?>"> </tr> <tr> <input type="text" name="TB_Col" id="TB_Col" maxlength="15" value="<?php echo $reg["color"];?>"> </tr> <tr> <input type="text" name="TB_Emp" id="TB_Emp" value="empaque"> </tr> <tr> <input type="text" name="TB_Cdb" id="TB_Cdb" maxlength="13" onkeypress="return justNumbers(event);" value="<?php echo $reg["codigobarras"];?>"> </select> </tr> <tr> <input type="text" name="TB_Cdc" id="TB_Cdc" maxlength="3" value="<?php echo $reg["codcolor"];?>"> </tr> <tr> </tr> <tr> <input type="text" name="TB_Acr" id="TB_Arc" maxlength="3" value="<?php echo $reg["acrilico"];?>"> </tr> <tr> <input type="text" name="TB_Pol" id="TB_Pol" maxlength="3" value="<?php echo $reg["poliamida"];?>"> </tr> <tr> <input type="text" name="TB_Ela" id="TB_Ela" maxlength="3" value="<?php echo $reg["elastomero"];?>"> </tr> <tr> <input type="text" name="TB_Alg" id="TB_Alg" maxlength="3" value="<?php echo $reg["algodon"];?>"> </tr> <tr> <input type="text" name="TB_Poli" id="TB_Poli" maxlength="3" value="<?php echo $reg["poliester"];?>"> </tr> <tr> <input type="text" name="TB_Cau" id="TB_Cau" maxlength="3" value="<?php echo $reg["caucho"];?>"> </tr> <tr> <td> </td> </tr> <tr> </tr> <input type="submit" name="B_Actualizar" id="B_Actualizar" value="Actualizar Datos" > </table> </form> <td width="240" align="left"> </td> </h3> </section> <table width="75" border="0"> <tr> <td width="51"> </td> <td width="49%"> </td> </tr> </table> <!--start holder--> <?php } ?>
Archivo LogicActualizar.php
Código PHP:
<?php
include('../Javascript/Mensajes.php');
include('../Javascript/Control.php');
include ('conexion.php');
$TB_Ref = $_POST ['TB_Ref'];
$TB_Tall = $_POST ['TB_Tall'];
$TB_Mar = $_POST ['TB_Mar'];
$TB_Col = $_POST ['TB_Col'];
$TB_Emp = $_POST ['TB_Emp'];
$TB_Cdb = $_POST ['TB_Cdb'];
$TB_Cdc = $_POST ['TB_Cdc'];
$TB_Acr = $_POST ['TB_Acr'];
$TB_Pol = $_POST ['TB_Pol'];
$TB_Ela = $_POST ['TB_Ela'];
$TB_Alg = $_POST ['TB_Alg'];
$TB_Poli = $_POST ['TB_Poli'];
$TB_Cau = $_POST ['TB_Cau'];
$reg = mysql_query ("UPDATE codigos SET referencia='$TB_Ref',talla='$TB_Tall',marca='$TB_Mar',color='$TB_Col',empaque='$TB_Emp',codigobarras='$TB_Cdb',codcolor='$TB_Cdc',acrilico='$TB_Acr',poliamida='$TB_Pol',elastomero='$TB_Ela',algodon='$TB_Alg',poliester='$TB_Poli',caucho='$TB_Cau' WHERE referencia='$TB_Ref'");
if ($reg){
Msg_Personalizado("Ha registrado Referencia satisfactoriamente");
header ("Location: ../Presentacion/ModifyRefe.php?referencia=".$_POST ['TB_Ref']);
} else {
echo "Error de actualizacion ". mysql_error ();
}
?>