在我的數據庫我有這樣的:更新查詢到的圖像
<p>Evento de Natal <img alt="" src="http://2.bp.blogspot.com/-kGiurC1ZAYY/TtxsnlfGfOI/AAAAAAAAAZA/A_QbRtqNnJU/s1600/40arvoresnatalmagiagifs.gif" style="float:right; height:199px; width:200px" /></p>
當我插入這個代碼在DB工作正常。 但是當我嘗試更新具有相同代碼的數據庫以更新函數時,它會給出以下錯誤:http://i.imgur.com/W89z9Hl.png
建議不要直接在數據庫中插入HTML?我怎麼做? 這裏是我的功能插入和更新。
public function insertNew($data) {
$this->db->insert('noticias', $data);
redirect(site_url('/') . 'admin/');
}
public function updateNew($id, $title, $noticia, $event) { $this->db->query('UPDATE noticias SET title="' . $title . '" , noticia="' . $noticia . '", event="' . $event . '" WHERE id= "' . $id . '"'); redirect(site_url('/') . 'admin/all_news'); }
謝謝!我知道了。每天學習一點。 :) – IRONLORD