I am trying to learn how to upload new records to MySQL table but seem to be failing so far. My attempt:
$uploaded = $_FILES["fileupload"]["name"];
`$try = mysqli_query($connect,"LOAD DATA INFILE IGNORE $uploaded INTO TABLE allrecords");`
I get an error. It's expected though as the code is a mess. I tried searching in Google but all seem to offer only inserting each records one by one to the database. I used a tag to select the Excel CSV file (exported from Excel) then on the receiving PHP file I use this query.
I use LOAD DATA INFILE IGNORE because I want to upload new records to the database but not include records who's primary key already exist in the database. Also I'm not sure how to do LOAD DATA INFILE and match each fields. Do I need to rename each column names/headers in Excel CSV to match the field names in database?
'/full/path/to/filename', and to ironically notignore 1 lines, and tweak line 1 to be perfect