How to fetch all in assoc array from a prepared statement?

前端 未结 6 749
北荒
北荒 2020-12-03 05:14

I\'m trying this code:

    if ($result = $this->mysqli->prepare(\"SELECT * FROM `mytable` WHERE `rows1`=?\"))
    {

        $result->bind_param(\"i         


        
6条回答
  •  我在风中等你
    2020-12-03 06:07

    The method execute() returns TRUE or FALSE not a result set and as such, the fetch_assoc method cannot be used as it does not exist on booleans. What you need is

    mysqli_fetch_assoc($result); //Use in association with query();
    

提交回复
热议问题