在我创建的模拟网站上出现此错误。不确定这里的实际问题是什么。任何帮助将不胜感激。谢谢!
错误:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home4/user/public_html/index.php on line 6
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home4/user/public_html/index.php on line 8
索引.php
<?php
include_once("php_includes/check_login_status.php");
$sql = "SELECT username FROM users WHERE activated = '1' ";
$query = mysqli_query($db_conx, $sql );
$usernumrows = mysql_num_rows($query);
$userlist = "";
while($row = mysql_fetch_array($query, MYSQLI_ASSOC)) {
$u = $row["username"];
$userlist .='<a href = "user.php?u='.$u.'">'.$u.'</a> | ';
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>RM</title>
<link rel="stylesheet" href="style/style.css">
<script src="js/main.js"></script>
</head>
<body>
<?php include_once("template_pageTop.php"); ?>
<div id="pageMiddle"> </div>
<?php include_once("template_pageBottom.php"); ?>
</body>
</html>