This code used to work but sundenly stopped.
I have a form to load the file. It works fine.. I can even COPY the file and import it manually. USING LOAD DATA LOCAL INFILE.
<form action="import.php" method="post" enctype="multipart/form-data">
<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="1000000">
<input type="hidden" name="field_terminater" size="2" maxlength="2" value="," />
<input type="hidden" name="enclosed" size="1" maxlength="1" value=""" />
<input type="hidden" name="escaped" size="2" maxlength="2" value="\" />
<input type="hidden" name="line_terminator" size="8" maxlength="8" value="\r\n" />
<center>
<table cellpadding="5" border="2">
<tr><td><input type="file" name="textfile"></td></tr>
<tr><td align="center"><input type="submit" name="submit" value="Import">
<input type="reset"></td></tr>
</table>
</form>
Then I use the LOAD DATA LOCAL INFILE AS FOLLOWS
if (is_uploaded_file($textfile)) {
$sql = 'LOAD DATA LOCAL INFILE \'' . $textfile . '\'';
$sql .= ' INTO TABLE import';
$sql .= ' FIELDS TERMINATED BY \'' . $field_terminater . '\'';
$sql .= ' ENCLOSED BY \'' . $enclosed . '\'';
$sql .= ' ESCAPED BY \'' . $escaped . '\'';
$sql .= ' LINES TERMINATED BY \'' . $line_terminator . '\'';
$result = mysql_query($sql);
This fails.. the same code used to work. AM I missing something.. Also:
echo mysql_errno() . ": " . mysql_error(). "\n";
Returns and access denied message. Could it be that I don't have access to my tmp directory? And if this is the problem what are my options?
Thanks in advance for your help,
Glen Barnhardt