mysqli_query() always return true

前端 未结 4 1121
清歌不尽
清歌不尽 2021-01-03 10:58

This is my form:



  
  
  
    
4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-03 11:41

    One needs to test to see if $r is true, and if row count is greater than 0.

    The following works:

    if ($r and mysqli_num_rows($r) > 0) {
    
      echo "rows exist"; } else {
    
    echo "rows don't exist";  }
    

提交回复
热议问题