我正在尝试获取其中存在的行数referral_in
(referral_out
作为单独的变量)。这是我的代码:
$username = $_SESSION['username'];
$connect = mysql_connect("xxxx", "xxxx", "xxxx!") or die("Couldnt Connect to Server");
mysql_select_db("xxxxx") or die("Couldnt find database");
$samecheck = mysql_query("SELECT `referral_in` FROM `users` WERE `username`=$username");
$same = mysql_num_rows($namecheck);
$leadcheck = mysql_query("SELECT `referral_out` FROM `users` WERE `username`=$username");
$leading = mysql_num_rows($namecheck);
echo "$leading / $same"
何时执行此操作,我收到此错误:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/content/50/8492150/html/buyarandom/member.php on line 23
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/content/50/8492150/html/buyarandom/member.php on line 25