SELECT statement with fetch_array in mysqli prepared statements

后端 未结 2 1891
既然无缘
既然无缘 2020-11-30 13:36

I always find it difficult to write MySQLi prepared statements, because many functions work differently than in the old way. Right now I am facing a problem regarding

2条回答
  •  醉梦人生
    2020-11-30 14:00

    replace this:

        $result = $stmt->execute();
        while ($row = $result->fetch_array()) {
    

    by this

      $stmt->bind_result($category_id);
    
      while($stmt->fetch()){
           $myArray=$category_id;
      }
    

提交回复
热议问题