I am using MySQL LOAD DATA INFILE
command. It is showing blank output and no insertion in mySQL DB.
mysql_connect("localhost", "user", "pwd*")or die("cannot connect");
mysql_select_db("my_db")or die("cannot select DB");
$sql="LOAD DATA LOCAL INFILE 'users.csv' INTO TABLE usersystem
FIELDS TERMINATED BY ',' ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
IGNORE 1 LINES
(email,password,fname,lname)";
$result=mysql_query($sql);
if($result){
echo "DONE"
}
else {
echo "ERROR";
}
mysql_close();
Why doesn't it insert rows?