INDEX Key to protect duplicate data insertion ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ahmurad
    New Member
    • Aug 2007
    • 19

    INDEX Key to protect duplicate data insertion ?

    Dear Xperts,

    I am trying to insert huge data (csv format) to MySQL database by using php script. In database I've used INDEX Key of column f2 & f24 so that only f2 & f24 are same then data will be uploded. but here all data uploaded with duplicate entry.


    Indexes:
    Keyname Type Cardinality Action Field
    PRIMARY PRIMARY 20 SL
    sam_idx I NDEX None f2
    f24

    if f2 and f24 column's values are already exist in database (compareable csv data to db data) then no data will be upload.

    pls suggest me best.

    AHMurad
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    #2
    It is UNIQUE not INDEX to prevent duplicates.
    Or create the primary key across two fields.

    Comment

    Working...