mysqli_num_rows() expects parameter 1 to be mysqli_result, object

前端 未结 3 1808
天命终不由人
天命终不由人 2020-12-11 22:10

This is my first experience with mysqli. It seems to be looking for the name of a result set in between the parentheses in mysqli_num_rows(). Yet when I tried $stmt, $conn,

3条回答
  •  伪装坚强ぢ
    2020-12-11 22:36

    You're combining procedural and object oriented approaches, when you only want object oriented. Change

    $num=mysqli_num_rows($WHAT);
    

    to

    $num = $stmt->num_rows();
    

提交回复
热议问题