duanditang2916
2019-04-26 13:26
浏览 304
已采纳

如何在WHERE子句上使用多个OR?

I am having a problem with my MYSQL statement

Warning : mysqli_num_rows() expects parameter 1 to be mysqli_result, bool given in C:\Users\R.B.Lara\Documents\My Projects\focalnews\index.php on line 188

$sqltype = "SELECT * FROM focalnews_items ORDER BY datime ASC limit $last,20 WHERE (likes >= 5 OR love >= 5 OR informative >= 5)";

$resulttype = mysqli_query($conn, $sqltype);

if (mysqli_num_rows($resulttype) > 0) {
    while($row = mysqli_fetch_assoc($resulttype))
    {
        $profile_pic = $row["profile_pic"];
        $author = $row["author"];
        $message = $row["message"];
        $likes = $row["likes"];
        $love = $row["love"];
        $informative = $row["informative"];
        $datime = $row["datime"];
        $joined_date = $row["joined_date"];
    }
}
?>

Any Idea please?

1条回答 默认 最新

相关推荐 更多相似问题