Displays error:

Warning: mysqli_fetch_row () expects parameter 1 to be mysqli_result, boolean given in

how to fix it

$pol = mysqli_query($conn, "SELECT sum,time,comenter FROM out"); while ($row = mysqli_fetch_row($pol)){//"ошибка в этой строке" echo " <tr> <td>".$row['sum']."</td> <td>".$row['time']."</td> <td>".$row['comenter']."</td> </tr>"; }; 

Reported as a duplicate by participants Alexey Shimansky , Grundy , Nicolas Chabanovsky 16 Dec '16 at 11:55 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

    2 answers 2

    mysqli_query returns FALSE on failure. in this case, the mysqli_fetch_row function will be called with the false parameter

    Here is the documentation

    • how can i fix it ?? - Mark
    • one
      Wrap the loop code in checking if ($ pol) - Roman Polshikov
    • @max ru.stackoverflow.com/questions/423439/… read, everything is written there and use the search please - Alex Shimansky

    And so ?:

     $pol = mysqli_query($conn, "SELECT sum,time,comenter FROM `out`");