为什么mysqli_free_result说警告:mysqli_query():无法获取mysqli

时间:2019-07-03 11:18:12

标签: php

我有这个代码

function myfunction($filter, $connection)
{
    $result = false;
    $queryresult = mysqli_query($connection, "SELECT field1 FROM table1 WHERE field2 = '$filter'");
    if ($queryresult && mysqli_num_rows($queryresult) >= 1) {
        $row = mysqli_fetch_array($queryresult);
        $result = $row['field1'];
        mysqli_free_result($queryresult);
    }
    return $result;
}

如果我删除mysqli_free_result($ queryresult),该功能还可以,但是出了什么问题呢?

0 个答案:

没有答案