1
I am having an error log that does not happen frequently. On average 1 time per month. The problem is that I am not identifying the error. I’ll put my select on so you can see if there’s something wrong.
$result = $mysqli->query("
SELECT SUM(a.qtd)
FROM
produtos_pedidos a,
pedidos b
WHERE
a.id_pedido = b.id
and (b.status = 0 or b.status = 4 or b.status = 7)
and a.id_produto = $produto
and b.pdv = 'n'
");
$row = mysqli_fetch_array($result);
$qtd_penhora = (float) $row['SUM(a.qtd)'];
The error log and this one:
[09-Jan-2017 16:56:55 America/Sao_Paulo] PHP Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /var/www/webroot/ROOT/Funcoes/Movimentacao.php on line 35
The line that occurs and error is this one:
$row = mysqli_fetch_array($result);
There’s something wrong with the select?
Put your query into a variable. And it gives an echo
$query
. Take the return and run it in your DBMS. See if it returns results or not. What you can not do is error. Apparently right. I don’t know how you’re making the connection.– Diego Souza
well I’ll test that you said.
– Hugo Borges