Hi, I am trying to load text file. HEre is my code .It says errorcode 2
<?php
require_once("mainfile.php");
global $dbi;
echo "<input type=\"hidden\" name=\"file\" value=\"C:\\hadith.txt\">";
$sql=" LOAD DATA LOCAL INFILE '$file' INTO TABLE hadith FIELDS TERMINATED BY '@'
LINES TERMINATED BY '|'(volume, book, number, hadith)";
$result=mysql_query($sql,$dbi);
#$load=mysql_query("LOAD DATA LOCAL INFILE '$file1' INTO TABLE hadith FIELDS TERMINATED BY '@' ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '|' (volume, book, number, hadith)",$dbi);
if( !$result)
die("Something wrong:".mysql_error());
?>
Another thing why this line says parse error
$load=mysql_query("LOAD DATA LOCAL INFILE '$file1' INTO TABLE hadith FIELDS TERMINATED BY '@' ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '|' (volume, book, number, hadith)",$dbi);
I use the following code in phpmyadmin.It works. In the above code even i change file location to 'C:\WINDOWS\hadith.text' it does not work ???
LOAD DATA LOCAL INFILE 'C:\\WINDOWS\\hadith.text' INTO TABLE hadith FIELDS TERMINATED BY '@' ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '|' (volume, book, number, hadith)
sorry guys asking for so many questions.
thanks