-1
I’m having a problem with these mistakes:
Warning: mysqli_fetch_array() expects Parameter 1 to be mysqli_result, bool Given in C: xampp htdocs hpveiculos index.php on line 512
Warning: mysqli_fetch_array() expects Parameter 1 to be mysqli_result, bool Given in C: xampp htdocs hpveiculos index.php on line 516
Warning: mysqli_fetch_array() expects Parameter 1 to be mysqli_result, bool Given in C: xampp htdocs hpveiculos index.php on line 526
Code:
<?php
$filtros="";
if (isset($_GET['filtro_cat'])){
if ($_GET['filtro_cat']!=''){
$filtros="&& cat='".$_GET['filtro_cat']."'";
$qr=mysqli_query($conn, "SELECT SUM(valor) as total FROM movimentos WHERE tipo=1 && mes='$mes_hoje' && ano='$ano_hoje' $filtros");
$row=mysqli_fetch_array($qr);
$entradas=$row['total'];
$qr=mysqli_query($conn, "SELECT SUM(valor) as total FROM movimentos WHERE tipo=0 && mes='$mes_hoje' && ano='$ano_hoje' $filtros");
$row=mysqli_fetch_array($qr);
$saidas=$row['total'];
$resultado_mes=$entradas-$saidas;
}
}
$qr=mysqli_query($conn, "SELECT * FROM movimentos WHERE mes='$mes_hoje' && ano='$ano_hoje' $filtros ORDER By dia");
$cont=0;
while ($row=mysqli_fetch_array($qr)) {
$cont++;
$cat = $row['categoria_id'];
$qr2=mysqli_query($conn, "SELECT nome FROM categorias WHERE id='$cat'");
$row2=mysqli_fetch_array($qr2);
$categoria=$row2['nome'];
?>
Possible duplicate of Mysql error "expects Parameter 1 to be Resource, Boolean Given in" ... Warning: mysqli_fetch_assoc() expects Parameter 1 to be mysqli_result, Boolean Given in
– NoobSaibot
This happens basically because some SQL of yours is wrong. For more details use the function
mysqli_error
.– Woss