I come to you because I already exhaust the options. I already checked the answers and none of them answered my problem to see if you see the error ... This is my code:
$Clave=$_POST["f_Clave"];
$Cantidad=$_POST["f_Cantidad"];
$Categoria=$_POST["f_Categoria"];
$Proveedor=$_POST["f_Proveedor"];
$Nombre=$_POST["f_Nombre"];
$Uni=$_POST["f_Uni"];
$Peso=$_POST["f_Peso"];
$Precio=$_POST["f_Precio"];
$Costo=$_POST["f_Costo"];
$sql="UPDATE INGREDIENTES SET
'Cantidad'=:m_Cantidad,
'Categoria'=:m_Categoria,
'Proveedor'=:m_Proveedor,
'Nombre'=:m_Nombre,
'Uni'=:m_Uni,
'Peso'=:m_Peso,
'Precio'=:m_Precio,
'Costo':=m_Costo
WHERE 'Clave'=:m_Clave";
$resultado=$base->prepare($sql);
$resultado->execute(array(
":m_Clave"=>$Clave,
":m_Cantidad"=>$Cantidad,
":m_Categoria"=>$Categoria,
":m_Proveedor"=>$Proveedor,
":m_Nombre"=>$No,
":m_Uni"=>$Uni,
":m_Peso"=>$Peso,
":m_Precio"=>$Precio,
":m_Costo"=>$Costo));
header("Location:index.php");
}
this is the connection with the BBDD
try{
$base=new PDO("mysql:host=localhost; dbname=antojitos_factory", "root", "");
$base->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$base->exec("SET CHARACTER SET UTF8");
}catch(Exception $e){
die('¡Error! ->' . $e->getMessage());
echo "Error en la Linea: " . $e->getLine();
}
?>
the error is given to me in the "execute" .. I do not see the fault, the table has all the fields to update ... already check all the fields; and according to me everything is fine I do not see the flaw.
The table has the fields that are seen when defining the variables; and in that order are the fields
I hope you can help me
Thank you for your support ...