I'm very new to PHP, with basic understanding. However I am in need of being able to pass data from a text file to a mysql database.
The text file contains all the data I need, and it is all tab separated and on separate rows for separate entries, so 24 columns and the data is in the same order on each row.(sorry for stating obvious, but want to be clear to get best answer fast) I need all the data importing, so no specific rows or columns. I have already made the database structure using phpmMyAdmin. So it is a table in a database, one thing I've noticed is that the code I've found never specifies the database and the table, either one or the other, this confuses me.
It is just needed for a localhost server running xampp.
I've been searching for ways for the last 2 days I have found many results, but most are very specific to the individual, or have extra code for queries n' such and with my limited understanding right now it makes it hard to filter out what I need.
The first thing I found was
LOAD DATA INFILE '/tmp/exampleFile.txt' INTO TABLE TableExample;
Which with to me seems to good to be true, but sadly this didn't work, I simply got the error: "Parse error: syntax error, unexpected 'DATA' (T_STRING)"
I'm sure this has been answered as simply as I am asking now somewhere but in my current tired state I have not found it.