mysqli_num_rows($ result)== 0总是返回true

时间:2015-07-02 14:50:51

标签: php mysql mysqli

在下面的代码中mysql_num_rows($result) == 0总是返回true,即使它中有行

$sql = "SELECT * FROM `kit-workshop` WHERE `wid` = ".$_SESSION['workshop']." AND returned is NULL";
     echo $sql;
     $result=mysqli_query($conn,$sql);
     if (mysql_num_rows($result) == 0) { 
                echo("<script>alert('All kits from this workshop have been added');</script>");
                mysqli_query($conn,"UPDATE workshop set status = 'close'");
                echo("<a href='kit.html'>Go to home</a>");
     }

0 个答案:

没有答案