Gday all,
just wondering if one of you guys.girls can give me a hand with this one. Im pretty new to php and am having difficulties in running this commend via a php page.
If i log into the mysql server itself the command runs fine, but as soon as i put it into a php page, i get parse errors.
This is what im trying to do.
<?
mysql_connect("localhost","user","pass") or die("Unable to connect to MYSQL server");
mysql_select_db("databasename") or die("Unable to select database");
$insert_data=("LOAD DATA INFILE '/dir/to/file/filename.csv' INTO TABLE tablename FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\r\n'");
mysql_query($insert_data) or die ("couldnt insert");
?>
The error i am getting in return is:
Parse error: parse error in /blah/blah/blah/import.php on line 5
Any help anyone could give me would be greatly appreciated. Ive tried all sorts of things to get it to work....i think it may have something do to with all of "'s and ''s......but not entirely sure.
Thanx for any help
Dave