When you insert a record in multiple batches, a single insert into inserts multiple identical records, and what is the case.
How it should be resolved
Reply to discussion (solution)
Please post the code!!!
When batch is added, do you want to loop it once and add it once, please check the code.
for ($i =0; $i < $s; $i + +) {
$iaps = $IAP [$i];
$daqs = $daq [$i];
$row =mysql_query ("SELECT count (*) from ' DLs ' where ' IAP ' = ' $iaps '"); Check for duplicate data
$row =mysql_fetch_row ($row);
if ($row [0]) {continue;}
mysql_query ("INSERT INTO ' DLS ' (' IAP ', ' Daq ', ' kt ') value (' $iaps ', ' $daqs ', ' kt ')");
}
There is a problem with the loop.
1, the best way to solve the cycle.
2, a field creates a unique index to avoid repeated insertions.
2, avoid repeated insertions with the insert into from dual where NOT EXISTS statement
INSERT into [table name] SELECT ' [value1] ', ' [value2] ' from DUAL
WHERE not EXISTS (
SELECT [Column1] from [same table name]
WHERE [column1]= ' [value1] '
and [column2]= ' [value2] ' LIMIT 1
)
It is best to do things with transactions and ensure consistency.
$row =mysql_fetch_row ($row);
Var_dump ($row); Print results look.