using LOAD DATA LOCAL INFILE
I have gotten great help using this LOAD DATA LOCAL INFILE This is very nice. I was wondering if anyone knows how to skip fields on the upload. The csv file has 126 columns, I only need to import about 15 of those. Do I need to alter the table I have to accept those 15? or is there something in the PHP that I need to be doing to import those columns or Both?
Here is my code:
PHP Code:
<?php
if (isset($_POST['load']))
{
include '_inc/include.php';
$temp = $_FILES['myfile']['tmp_name'];
$sqlstatement="LOAD DATA LOCAL INFILE '$temp' INTO TABLE carboncounty_PA02 FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\r\n' IGNORE 1 LINES";
mysql_query($sqlstatement) or die(mysql_error());
echo "It worked";
}
?>