执行数据库查询时出现以下错误:
发生数据库错误
错误号:1062
键“PRIMARY”的重复条目“1”
更新
tbl_galeri
集id_galeri
= '1',galeri_kat_id
= '1',nama
= 'Elyza Okiliyandass',foto
= 0,deskripsi
= 'Elyza Okiliyanda'文件名:C:\xampp\htdocs\indonesiausher\system\database\DB_driver.php
行号:330
控制器:
$pilih['id_galeri'] = $this->uri->segment(3);
$dt_galeri = $this->app_model->getSelectedData("tbl_galeri",$pilih);
foreach($dt_galeri->result() as $db)
{
$bc['id_galeri'] = $db->id_galeri;
$bc['galeri_kat_id'] = $db->galeri_kat_id;
$bc['nama'] = $db->nama;
$bc['foto'] = $db->foto;
$bc['deskripsi'] = $db->deskripsi;
$bc['stts'] = "edit";
}
$this->load->view('backend/gallery/bg_input_usher',$bc);
}
模型:
public function getSelectedData($table,$data)
{
return $this->db->get_where($table, $data);
}
如何处理这个错误?谢谢..