Hola como están
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 <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"> <td width="22%">*Referencia:
</td> <td width="32%"><div align="left"> <input type="text" name="TB_Ref" id="TB_Ref" value="<?php echo $reg["referencia"];?>">
<input type="text" name="TB_Tall" id="TB_Tall" maxlength="5" value="<?php echo $reg["talla"];?>" >
<input type="text" name="TB_Mar" id="TB_Mar" value="<?php echo $reg["marca"];?>">
<input type="text" name="TB_Col" id="TB_Col" maxlength="15" value="<?php echo $reg["color"];?>">
<input type="text" name="TB_Emp" id="TB_Emp" value="empaque">
<input type="text" name="TB_Cdb" id="TB_Cdb" maxlength="13" onkeypress="return justNumbers(event);" value="<?php echo $reg["codigobarras"];?>">
<input type="text" name="TB_Cdc" id="TB_Cdc" maxlength="3" value="<?php echo $reg["codcolor"];?>">
<td width="8%">*Acrilico:
</td> <td width="38%"><div align="left"> <input type="text" name="TB_Acr" id="TB_Arc" maxlength="3" value="<?php echo $reg["acrilico"];?>">
<input type="text" name="TB_Pol" id="TB_Pol" maxlength="3" value="<?php echo $reg["poliamida"];?>">
<input type="text" name="TB_Ela" id="TB_Ela" maxlength="3" value="<?php echo $reg["elastomero"];?>">
<input type="text" name="TB_Alg" id="TB_Alg" maxlength="3" value="<?php echo $reg["algodon"];?>">
<input type="text" name="TB_Poli" id="TB_Poli" maxlength="3" value="<?php echo $reg["poliester"];?>">
<input type="text" name="TB_Cau" id="TB_Cau" maxlength="3" value="<?php echo $reg["caucho"];?>">
<td colspan="4" align="left"><div align="left"> <input type="submit" name="B_Actualizar" id="B_Actualizar" value="Actualizar Datos" >
<td width="240" align="left">
<table width="75" border="0">
<div align="right"><input type="button" value="Modificar" onclick="activar()" /></div> <div align="left"><input type="submit" name="B_Borrar" id="B_Borrar" value="Eliminar" onClick="eliminar()"></div> <!--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 ();
}
?>