duansha8115 2014-09-08 17:36
浏览 184
已采纳

警告:mysqli_fetch_array()期望参数1为mysqli_result,[closed]中给出的字符串

<?php
 $bla=$_GET['category'];
   $bla1= " SELECT * FROM project where id=$bla ";
      $result1= mysqli_query($db, $bla1);
                if(!$result1) {
                die("hehehe");
                             } 
   while($result2 = mysqli_fetch_array('result1')){ 
   echo $result2['project_name'] ;
        }
?>

whats wrong in this? I am getting this warning

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, string given in ...

  • 写回答

1条回答 默认 最新

  • dsirr48088 2014-09-08 17:38
    关注

    Use

    mysqli_fetch_array($result1)
    

    instead of

    mysqli_fetch_array('result1')
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?