2022-07-28

Duplicate entry for key 'PRIMARY' codeigniter

i got error Duplicate entry '19-0' for key 'PRIMARY' after insert all multiple to database

$resp = curl_exec($curl);
$gorong = json_decode($resp);
foreach ($gorong->data as $g){
                        $this->db->insert('mod_auto_harga', array(
                        'sv_id' => '19',
                        'kode' => $g->buyer_sku_code,
                        'keterangan' => $g->product_name,
                        'harga' => $g->price,
                        'status' => $g->seller_product_status,
                        'type' => $g->type,
                        ));
     
        $id = $this->db->insert_id();
 

enter image description here



No comments:

Post a Comment