The following code works in my localhost server installed in a linux system:
PHP Code:
<?php
$conn = mysql_connect("localhost", "root", "****");
mysql_select_db("test", $conn);
$sql = "load data infile '/var/www/html/member.txt' into table `load_data`
FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (name, password)";
$result = mysql_query($sql, $conn);
if(!$result) echo "DB error";
?>
I tried a similar code with .dat file (instead of .txt file) in 000webhost.com server, and it did not work
(I got "DB error" message). It might be because a user is not granted with 'file' privilege.