-1
Hello! I’m getting this message while trying to display the page.
Notice: Undefined index: Identregator in C: wamp64 www Solus resume_dia.php on line 378
On line 378 I have the following structure.
375- $sqlEntregasRetornos_res = $conn->prepare($sqlEntregasRetornos);
376- $sqlEntregasRetornos_res->execute();
377- $lstEntregasRet = $sqlEntregasRetornos_res>fetchAll(PDO::FETCH_ASSOC);
378- $teste = $lstEntregasRet["IdEntregador"];
379- var_dump($lstEntregasRet);
// Na linha 378 também tentei extrair da seguinte forma
$lstEntregasRet["IdEntregador"];
When displaying the contents of the variable it is correctly displaying the information. As below:
array (size=8)
0 =>
array (size=3)
'IdEntregador' => string '4' (length=1)
'QtdeRetorno' => string '4' (length=1)
'Descricao' => string 'RETORNO' (length=7)
1 =>
array (size=3)
'IdEntregador' => string '20' (length=2)
'QtdeRetorno' => string '1' (length=1)
'Descricao' => string 'RETORNO' (length=7)
The $test variable returns null C: wamp64 www Solus abstract.php:381:null
Honestly, I don’t know what I could be doing wrong, I have four other structures that are working perfectly, I’ve already checked all the information and I don’t know what’s wrong. I had another situation similar to this, but I solved in 2 min, the problem was in the foreach structure, which is not the case now.
In line 377 the correct is $sqlEntregasRetornos_res->fetchAll(PDO::FETCH_ASSOC)
– Victor Eyer
It was missing a '-' before the '>'
– Victor Eyer
I think that is not the problem, because if you notice, I inserted the '-> ' in this case it would return an 'Error' instead of the existing value in the variable.
– Jefferson Amorim