我在下面的代码中收到一条错误消息“mysql_num_rows():提供的参数不是...第 200 行中的有效 MySQL 结果资源”,这似乎没问题,因为我在另一个脚本中也有类似的代码:
//Reference Code Validation...
$ref_check = mysql_query("SELECT id FROM References WHERE Ref_Code='$ref_code' LIMIT 1");
$number = mysql_num_rows($ref_check);//line no 200
if ($number > 0) {
$new_user_check = mysql_query("SELECT New_User FROM References WHERE Ref_Code='$ref_code' LIMIT 1");
$result = mysql_fetch_array($new_user_check);
$data = $result['New_User'];
if($data!==Null){
echo 'This reference code was already redeemed. Please check or leave it blank';
exit ();
}
else{
echo 'Reference code is invalid. Please check and try again';
exit ();
}