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



Comments

Popular posts from this blog

Today Walkin 14th-Sept

Hibernate Search - Elasticsearch with JSON manipulation

Spring Elasticsearch Operations