这个脚本总是返回一个,而不是实际的在线用户数。任何人都可以帮助修复我的代码吗?
$oq = "SELECT user FROM user_archive WHERE time > (NOW() - INTERVAL 5 MINUTE)";
$oresult = mysqli_query($con,$oq);
$online_users = mysqli_num_rows($oresult);
if($online_users = 1)
{
echo "{$online_users} user online";
}
if($online_users != 1)
{
echo "{$online_users} users online";
}