[1064: 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 ')' at line 1] in EXECUTE("INSERT INTO mailer_recipients (status,send_result_id) VALUES (,)")
public function saveData($status, $resultId)
{
global $dbwriter;
// Update send result, send result ID, status
$sql = 'UPDATE ' . $this->recipientDbTable . ' SET ' . $this->recipientDbColumn['status'] . "='$status' WHERE " . $this->recipientDbColumn['id'] . '=' . $this->getId();
$sql = 'UPDATE ' . $this->recipientDbTable . ' SET ' . $this->recipientDbColumn['result_id'] . "='$resultId' WHERE " . $this->recipientDbColumn['id'] . '=' . $this->getId();
$sql = 'INSERT INTO ' . $this->recipientDbTable;
$sql .= ' (' . $this->recipientDbColumn['status'] . ',' . $this->recipientDbColumn['result_id'] . ')';
$sql .= ' VALUES ' . '(' . $status . ',' . $resultId . ')';
$result = $dbwriter->execute($sql);
}
UPDATE很好。不知道是什么问题。
答案 0 :(得分:1)
阅读您的错误消息。您的SQL以VALUES (,)
结尾,这是无效的语法。显然,$status
和$resultId
为空(''
,null
或其他评估为空字符串的值。)