-1
那麼,我最近一直在研究一個新項目,並且我已經創建了一個基本的通訊系統。我會努力讓它稍後更先進;目前我有兩個錯誤。該UPDATE
功能,我使用的是不工作,我得到錯誤信息新聞系統驗證錯誤,mysql_num_rows和UPDATE查詢
mysql_num_rows expects parameters to be more than 0
代碼
public function newsActivate($email, $key) {
global $db;
echo $email . $key;
$qry = $db->query("SELECT * FROM `newsletter` WHERE key='$key' && activated='1'");
$num = $db->num($qry);
if ($num == 0) {
$db->query("UPDATE `newsletter` SET activated='1' WHERE `email`='$email' && `activaton_key`='$key'");
echo "Your email address has been activated.";
} else {
echo "Your email has already been activated.";
}
}
非常感謝您的幫助:)