Home>

What are the meanings of the following two errors?

First
Warning: mysqli_fetch_array () expects parameter 1 to be mysqli_result, bool given in C: \ xampp \ htdocs \ hotel \ test_managers_query.php on line 82
Second
Warning: mysqli_free_result () expects parameter 1 to be mysqli_result, bool given in C: \ xampp \ htdocs \ hotel \ test_managers_query.php on line 96

  • Answer # 1

    I wonder if the database connection failed and the query was executed with FALSE.

    PHP: mysqli_result :: fetch_array-Manual
    Supplementing with reference to the "Example 2 Procedural" case in
    $row = mysqli_fetch_array ($result, MYSQLI_ASSOC);
    $resultshould be FALSE or something.

    The place where$resultis packed in this case is

    $query = "SELECT Name, CountryCode FROM City ORDER by ID LIMIT 3";
    $result = mysqli_query ($link, $query);


    So$linkwas FALSE due to database connection in the first place, or
    There is a possibility that the SQL statement given by$queryis a grammatical error.

  • Answer # 2

    google translation
    Warning: mysqli_fetch_array () expects parameter 1 to be mysqli_result and given bool in C: \ xampp \ htdocs \ hotel \ test_managers_query.php on line 82
    Second
    Warning: mysqli_free_result () expects parameter 1 to be mysqli_result and given bool in C: \ xampp \ htdocs \ hotel \ test_managers_query.php on line 96

  • Answer # 3

    mysqli_fetch_array () and mysqli_free_result () Is a strange usage
    Check lines 82 and 96

Related articles