I have a database on my main computer filled with records of different products, I needed to perform a search and after the product was found through the bar code it would proceed to add an amount entered by a user, the part of the connection to the database works for me and the same to search, the part of the sum is the one that I can not specify. in my search engine I have this code:
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Buscador</title>
</head>
<body>
<form action="buscador.php" method="POST" autocomplete="off">
<input type="text" name="palabra" placeholder="¿Qué esta buscando?">
<input type="submit" value="Buscar">
</form>
<?php
if(isset($_POST['palabra'])){
require_once "php/connect.php";
require_once "procesos/buscar.php";
}
?>
<form action="buscador.php" method="POST" autocomplete="off">
<input type="text" name="conteo" placeholder="Cantidad">
<input type="submit" value="Sumar">
</form>
<?php
if(isset($_POST['conteo'])){
require_once "php/connect.php";
require_once "procesos/conteo.php";
}
?>
</body>
</html>'
In the count.php I have this code:
<?php
$conteo=$_POST['conteo'];
$palabra=$_POST['palabra'];
$query= "UPDATE inventario_principal SET conteo = conteo + '%$conteo%' WHERE codigo = '%$palabra%'";
But I still can not make it work, I'm pretty new to php and I would like to know what the problem is. The error it gives me is that the variable "Word" has no index but I think it is declared in the first form.