I am using the following (working) php/mysql statement to load CSV files into a MYSQL database:
$sql = 'LOAD DATA INFILE \'C:\\DOCUME~1\\IANLES~1\\LOCALS~1\\Temp\\php98B.tmp\' INTO TABLE sbdata FIELDS TERMINATED BY \',\' ENCLOSED BY \'"\' ESCAPED BY \'\\\' LINES TERMINATED BY \'\r\n\'';
What I need to do now is add a field to each record as it is inserted with information entered by the user before uploading the CSV file. IE:
If I have a file with three columns as such:
COL1 COL2 COL3
1 2 3
4 5 6
7 8 9
10 11 12
etc.
I want it to be entered into MYSQL with an additional field with user input (ie user name, here I use my username, "IANUH")
COL1 COL2 COL3 COL4
1 2 3 IANUH
4 5 6 IANUH
7 8 9 IANUH
etc.
Any suggestions? I have searched at lenght, but am not even sure of the terminology for what I am trying to do.
Thanks,
Ian