MySQLi num_rows总是返回一个

时间:2018-05-13 09:24:05

标签: mysqli

$select = "SELECT rejected_id FROM booking_table WHERE id = '$booking_id'";
    $result=mysqli_query($link,$select);
    $row=mysqli_fetch_assoc($result);
    $count = mysqli_num_rows($result);
    echo $count ;
    $rejected_id = $row['rejected_id'] ;
    if($count>0){
        echo "enetr";

    $string = $rejected_id_ . "," . $rejected_id;
    }
    else{
        echo 'as';
    $string = $rejected_id_;   
    }

I am getting count as 1.Even if the query gives zero rows i.e it always enter if condition ,it never enters else condition.

我没有得到解决方案。 我得数为1.即使查询给出零行,即它总是进入条件,它永远不会进入其他条件。  我没有得到解决方案。

0 个答案:

没有答案