我有一个需要更新的表单我收到一个 sql 错误。在我的类文件中看不到我的 sql 语句发生了什么。需要帮助找出问题所在。
public function update(){
global $database;
$sql = "UPDATE ".self::$table_name." SET when = '{$database->mysql_prep($this->when)}', where = '{$database->mysql_prep($this->where)}', howmuch = '{$database->mysql_prep($this->howmuch)}', contact = '{$database->mysql_prep($this->contact)}', daytimephone = '{$database->mysql_prep($this->daytimephone)}', emailqueries = '{$database->mysql_prep($this->emailqueries)}', websiteurl = '{$database->mysql_prep($this->websiteurl)}', description = '{$database->mysql_prep($this->description)}' WHERE id='{$database->mysql_prep($this->id)}'";
$database->query($sql);
return ($database->affected_rows() == 1) ? true:false;
}