How can we insert data only in php and know that duplicate values exist when inserting data into the table consecutively? but how can we insert non-duplicate values into the table only, duplicate values cannot be inserted automatically. unique & nbsp; key, primary & nbsp; Key is not used. Insert & nbsp; into (a, B, c) & nbsp; table_name & nbsp; values & nbsp; (how can a1 and a2 only insert data?
In php, repeated values are already known when data is inserted into the table consecutively. but how can we insert non-repeated values into the table? duplicate values cannot be inserted automatically, the unique key and primary Key are not used.
Insert into ('A', 'B', 'C') table_name values ('A1 ', 'A2', 'A3 '), ('A4', 'a5 ', 'a6 '), ('a8', 'a7 ', 'a9 '). duplicate values ('A4 ', 'a5', 'a6 ') in the table. how can I insert a duplicate value ('A4', 'a5 ', 'a6 '), but you can insert ('A1', 'A2 ', 'A3'), ('a8', 'a7 ', 'a9 ').
PHP
Share:
------ Solution --------------------
Insert ignore into table_name VALUES ('A1 ', 'A2', 'A3 '), ('A4', 'a5 ', 'a6'), ('a8 ', 'a7 ', 'a9 ')