Error mysqli_fetch_array ()

0

Error:

  

error mysqli_fetch_array () expects parameter 1 to be mysqli_result, boolean given in

<?php
  if ($_SERVER['REQUEST_METHOD'] === 'POST'){
  $conexion = mysqli_connect("localhost", "root", "","henkel");
  $consulta ="SELECT DISTINCT*  FROM lote where Etapa=11 and Equipo = 2 or 5 or 4  order by HoraFinal DESC limit 50";
  $consulta2 ="SELECT DISTINCT * FROM lote where Etapa = 1 and Equipo = 2 or 5 or 4 ORDER BY HoraInicio DESC limit 20";
  $cosulta3 ="SELECT   HoraFinal FROM lote where Etapa = 11 and Equipo = 2  ORDER BY HoraFinal DESC limit 20";
  $cosulta4 ="SELECT  HoraInicio FROM lote where Etapa = 1 and Equipo = 2  ORDER BY HoraInicio DESC limit 20";
  $consulta5 ="SELECT DISTINCT time_to_sec(timediff(  MIN( HoraInicio ),MAX( HoraFinal ))) / 3600 FROM lote GROUP BY Lote'";

 if ($conexion -> connect_errno){

    die("Fallo la conexion:(".$conexion -> mysqli_connect_errno().")".$conexion-> mysqli_connect_error());

 }




if(ISSET($_POST['btnActualizar'])){

    $resconexion= mysqli_query($conexion,$consulta);

}

if(ISSET($_POST['btnTotal'])){


   $resconexion3= mysqli_query($conexion,$consulta5);


}

if(ISSET($_POST['btncomp'])){

    $resconexion2= mysqli_query($conexion,$consulta2);
}

}
?> 


 <!doctype html>
 <html lang="es">
   <form action ="Reportes.php" method ="post">
   <head>
      <title>Lotes</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">      

</head>

<body>

    <h2>Lotes terminados </h2>

<?php
if (isset($resconexion)){
    echo"<h2>lotes ter</h2> <table>" ;
  while($cont1=mysqli_fetch_array($resconexion)) { 
      echo    
    '<tr>'.

    '<td>'.$cont1['Lote'].'</td>'. 
      '<td>'.$cont1['IDH'].'</td>'.
      '<td>'.$cont1['NumOrden'].'</td>'.
      '<td>'.$cont1['Operador'].'</td>'.
      '<td>'.$cont1['Equipo'].'</td>'.
      '<td>'.$cont1['Etapa'].'</td>'.
      '<td>'.$cont1['HoraFinal'].'</td>'.

    '</tr>';
  }
    echo"</table>";
}
?>



    <?php

    if ( isset($resconexion3) ){
    echo"<h2>lotes ter</h2> <table>" ;
  while( $cont3=mysqli_fetch_array($resconexion3)) {//linea 114 
      echo    
    '<tr>'.

      '<td>'.$cont3['Tiemporeal'].'</td>'.
    '</tr>';
  }
    echo"</table>";
}
?>

<tr>
            <td><input type = "submit" name = "btnActualizar" value = "Actualizar"></td>


        </tr>

     <tr>
    <td><input type ="submit" name= "btnTotal" value= "Total"></td>
    </tr>

    <tr>
    <td><input type ="submit" name= "btncomp" value= "Comparar"></td>
    </tr>




 </body>
 </form>
 </html>[![introducir la descripción de la imagen aquí][1]][1]
    
asked by rolyx22 12.04.2018 в 21:47
source

0 answers