0
我知道我在表格中有多個結果,誰能告訴我我做錯了什麼?PHP,MySQL查詢總是返回1?
<?php
$con = mysql_connect("x","y","z");
if (!$con)
{
die(mysql_error());
}
mysql_select_db("mydatabase", $con);
$query = ("SELECT COUNT(*) FROM usersonline WHERE datetime > NOW() - INTERVAL 5 MINUTE");
$result = mysql_query($query);
$num_rows = mysql_num_rows($result);
echo $num_rows;
?>