I'm getting this error message:
PHP Warning: Illegal offset type in E: \ home \ topdeia \ Web \ n-chipi \ update-data.php on line 9
The code I have is this:
session_start();
$acao = $_POST['acao'];
if ( isset($acao) && $acao == 'atualizar-quantidade' ){
$id = isset($_POST["id_qtd"]) ? $_POST["id_qtd"] : null;
$_SESSION["quantidade"][$id] = $_POST['quantidade'];
}
Following a tip, I did this, I added (string)
session_start();
$acao = $_POST['acao'];
if ( isset($acao) && $acao == 'atualizar-quantidade' ){
$id = isset($_POST["id_qtd"]) ? $_POST["id_qtd"] : null;
**$_SESSION["quantidade"][$id] = (string)$_POST['quantidade'];**
}
The message persists.