I'm having an error log that does not happen often. On average 1 time per month. Problem is, I'm not picking the error. I'll put my select so you can see if something is 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 is the one here:
[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);
Is there anything wrong with select?