在我的模型中,我具有以下功能:
function update_blog($data, $id){
$id = $this->uri->segment(3);
$sql = "UPDATE database.newblog (name, address, email)
SET (".$this->db->escape($data['name']).",
".$this->db->escape($data['address']).",
'".$data['sEmail']."',
WHERE id = ".$id."; ";
echo $sql;
$query = $this->db->query($sql);
}
}
当我将此查询直接放入 SQLyog 时,它会出现错误:
错误代码:1064 您的 SQL 语法有错误;
?
谢谢