• You are not logged in. | Login

Post a reply

November 17, 2006 7:07 am

napkdd1
Member
Ranks

php parse error

Hi,

Could someone help me figure out why I get the a parse error when running this MySQL query?

Here is the statement getting an parse error

$readdata = "LOAD DATA INFILE 'customer1.csv' INTO TABLE 'customer1' FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\r\n'";


Thanks!


 

 

November 17, 2006 4:27 pm

phppat
Member
Ranks

Re: php parse error

Easy fix, you've got a " within your " quoted variable that should be escaped by a slash.. try this instead:

$readdata = "LOAD DATA INFILE 'customer1.csv' INTO TABLE 'customer1' FIELDS TERMINATED BY ',' ENCLOSED BY '\"' ESCAPED BY '\\' LINES TERMINATED BY '\r\n'";

Hope that helps!


PHP monster

 

 
  • Actions
  • Top
ITCrimea. Ukraine Web Development Company. Professional Developers and Web Designers Team
Custom Web Designs, Internet Applications, E-Commerce Websites, Interactive Sites, Database-Driven Sites and Services