I have every time I click on add this data continues to increase, now I only get that every time I click is updated but does not save the previous php is the following
<?php
session_start();
if(empty($_SESSION['producto'])){
$_SESSION['producto']=array();
}
// esto viene de js por trae el id del producto y la cantidad
ingresada
if(isset($_GET['p'])){
$_SESSION['producto']['id'] = $_GET['p'];
}
if(isset($_GET['c'])){
$_SESSION['producto']['can'] = $_GET['c'];
}
//incremento i en 2 para que ponga en la misma linea la cantidad y el
id
for ($i=1; $i < count($_SESSION['producto']); $i+=2){
$cab = $_SESSION['producto']['can'];
$query = mysqli_query($conect,'SELECT * FROM Productos WHERE
id='.$_SESSION['producto']['id'].'');
while ($fila = mysqli_fetch_array($query)) {
echo '<tr>';
echo '<td>'.$fila['Nombre'].'</td>';
echo '<center><td>';
echo '<center><input type="number" name="ja" class="la"
value="'.$cab.'""></center>';
echo '</td></center>';
This I get with this
but as I say it does not let me increase data just put the data of the last click I give