G'day again oh great PHPers.
I have written code that uploads a file to the server but now I can't use the LOAD DATA (LOCAL) INFILE command to import it.
I have seen an example and even looked in the manual but it just ain't working.
This is an example of the file contents:
INSERT INTO newhardware VALUES('', 'Cables & Connectors', 'Others', ' ', 'CBLVGA', 'ALTECH', 'CB-MT', 'VGA Extension cable - 1.8M', 'VGA Extension cable 1.8M', '6', '1', '2.73', '3', '25', '170', '240', '0.00102', '0.05', 'N/A', ' ', 'OEM Cables', '6', '2', '1423', '', ''); INSERT INTO newhardware VALUES('', 'Cables & Connectors', 'Others', ' ', 'CBLSERIAL-D9', 'ALTECH', 'WC7534', 'Serial Cable - D9F to D9M, 1.8m long', 'Serial Cable - D9F to D9M (9-pin female to 9-pin male connection), 1.8m long', '16', '1', '7.27', '8', '25', '160', '220', '0.00088', '0.05', 'N/A', ' ', 'OEM Cables', '16', '2', '1426', '', '');
This is the line that the code keeps stuffing up at:
$result = mysql_db_query('$user',"LOAD DATA INFILE '" . $uploaddir . "/" . $ulfilename . "' INTO TABLE newhardware FIELDS TERMINATED BY ',' ENCLOSED BY '\''");$User = the username for the database
$uploaddir . "/" . $ulfilename = ../filestores/oznetttest.txt (which is correct path)
But it always dies. (The code used to have a 'or die' as well but i removed it to see if it would help
(alternatively I am quite happy to load the file one line of code at a time and query each line individually, (but no idea how to retrieve 1 line at a time))