Jean-Loup
import from csv into multiple related tables
Ok so the upload form always wants to map author to one of the columns of the csv which means $state always has the same value. How do I make sure this $state contains multiple columns which can then be mapped to a single table columns?
21 replies
import from csv into multiple related tables
I'm not using authors but why not it works as an example. I can't give you the exact data I'm working with as it's confidential but for the sake of moving forward say I have a CSV of books and authors.
Both the author and book tables are empty to start with. I want for each line it reads to search if an author already exists and add one if not, then retrieve the author id from there to add it to the book table as a foreign key.
That's a 2-table example but of course I'll need to expand that to my 6 tables. Does that make sense?
21 replies