-1
下面的電子郵件查詢應該由名爲「ttemail」爲0的字段觸發。當我嘗試使用它時,我得到You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1' at line 1
。來自IF語句的MySQL錯誤
看來,電子郵件被髮送出去的至少第一個用戶名,其中TTEMAIL = 0
任何想法,爲什麼?
由於提前,
約翰
if($row["ttemail"] == 0){
$mailaddress = $row['email'];
$link1 = "<a href='http://www...com/page.php'>Page Title</a>";
$message1 = "Congratulations, message.
<br>
<br>
More Message
<br>
<br>
Please click the link below to see more.
<br>
<br>
$link1
";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From: Website Name <[email protected]>" . "\r\n";
$queryem = mail($mailaddress, "Congratulations, message
$submission.", $message1, $headers);
//$ttquery = sprintf("Update login SET ".$row['ttemail']." = '1' WHERE username = ".$row['username']."");
mysql_query($queryem) or die(mysql_error());
mysql_query($ttquery) or die(mysql_error());
} else {
}
等等,什麼?你使用`mail()`調用的返回值作爲MySQL查詢? – EboMike 2010-11-24 09:34:53