I have a large CSV file of 12000 rows and 90 columns.
I want to use the mysql load data infile query to upload it to my mysql database.
But I keep getting the error that my CSV has duplicates on the primary key.
I am sure that it does not have duplicates on the primary key.
What could be the problem?
here is my code
$sql = "LOAD DATA INFILE '/a_bysch_store (2).csv' INTO TABLE a_bysch"
. " FIELDS TERMINATED BY ','"
. " LINES TERMINATED BY '\r\n'"
. " IGNORE 1 LINES";
//Try to execute query (not stmt) and catch mysqli error from engine and php error
if (!($stmt = $mysqli->query($sql))) {
echo "\nQuery execute failed: ERRNO: (" . $mysqli->errno . ") " . $mysqli->error;
}