Just looking for some advice on the best way to go about inserting some data(and in the future updating) from a csv file into a mysql db table.
My server doesnt allow the command load data infile so using php just not sure the best approach as my csv file has less columns than the table and different headers than the table.
eg
CSV FILE
'PRODUCT_ID', 'PRICE', 'STOCK', 'DESCRIPTION'
table
products_id, products_price, products_stock, products_status, ect , ect,
Im guessing creating an array from the csv and assigning each column as a $variable then mapping this to the relevant columns in the table then inserting.
there are so many ways to go about the same thing just wanted a bit of advice on which route to take.
thanks for your time.
John.
My server doesnt allow the command load data infile so using php just not sure the best approach as my csv file has less columns than the table and different headers than the table.
eg
CSV FILE
'PRODUCT_ID', 'PRICE', 'STOCK', 'DESCRIPTION'
table
products_id, products_price, products_stock, products_status, ect , ect,
Im guessing creating an array from the csv and assigning each column as a $variable then mapping this to the relevant columns in the table then inserting.
there are so many ways to go about the same thing just wanted a bit of advice on which route to take.
thanks for your time.
John.