I get an error when I import sql file in phpmyadmin. Here is an error
--
-- Indexes for table 'tbl_disposisi'
--
ALTER TABLE 'tbl_disposisi'
ADD PRIMARY KEY ('disposisi_kd'),
ADD KEY 'fk_tbl_disposisi_tbl_berita_idx' ('arsip_kd')
#1062 - Duplicate entry '2' for key 'PRIMARY'
Does anyone know how to solve it? Thanks in advance
2
Answers
It is as @Akina says, you have multiple rows with the same
disposisi_kd
In reaction to the comment on how te show the duplicates:
should do the trick (don’t forget to replace
table_name
)you can also choose another primary key or use a couple of columns as primary key if you need:
https://www.w3schools.com/sql/sql_primarykey.ASP