On Thu, 2003-07-31 at 14:31, Roy W wrote:
> I have this:
>
> $query = "LOAD DATA LOCAL INFILE '/home/data.txt' INTO TABLE mytable FIELDS
> TERMINATED BY ',' ENCLOSED BY '" . '"' . "' ";
> $result = MYSQL_QUERY($query);
> PRINT "$query2";
>
> The query doesn't take ... but if I cut and paste the
> I have this:
>
> $query = "LOAD DATA LOCAL INFILE '/home/data.txt' INTO TABLE
> mytable FIELDS
> TERMINATED BY ',' ENCLOSED BY '" . '"' . "' ";
> $result = MYSQL_QUERY($query);
> PRINT "$query2";
>
> The query doesn't take ... but if I cut and paste the printed
> response into
> the mysql server
[snip]
Unfortunately, they are indeed enclosed by double quotes
[/snip]
Can you show us a snippet of data.txt?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Unfortunately, they are indeed enclosed by double quotes
Roy
-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 31, 2003 12:58 PM
To: Roy W; [EMAIL PROTECTED]
Subject: RE: [PHP] Escaping nasty quotes
[snip]
Sorry...Because of the double quote near
[snip]
Sorry...Because of the double quote near the ENCLOSED BY .. It delivers
a
PARSE ERROR
$query = "LOAD DATA LOCAL INFILE '/home/data.txt' INTO TABLE mytable
FIELDS
TERMINATED BY ',' ENCLOSED BY '"' ";
[/snip]
Are the fields enclosed by a quote? If not...
$query = "LOAD DATA LOCAL INFILE '/h
PROTECTED]
Subject: Re: [PHP] Escaping nasty quotes
--- Roy W <[EMAIL PROTECTED]> wrote:
> The query doesn't take ... but if I cut and paste the printed response
> into the mysql server manually ... works like a charm
http://www.php.net/addslashes
Chris
=
Become a better
Sorry...Because of the double quote near the ENCLOSED BY .. It delivers a
PARSE ERROR
?
-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 31, 2003 12:38 PM
To: Roy W; [EMAIL PROTECTED]
Subject: RE: [PHP] Escaping nasty quotes
[snip]
$query = "
--- Roy W <[EMAIL PROTECTED]> wrote:
> The query doesn't take ... but if I cut and paste the printed
> response into the mysql server manually ... works like a charm
http://www.php.net/addslashes
Chris
=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org
[snip]
$query = "LOAD DATA LOCAL INFILE '/home/data.txt' INTO TABLE mytable
FIELDS TERMINATED BY ',' ENCLOSED BY '" . '"' . "' ";
{/snip]
try ...
$query = "LOAD DATA LOCAL INFILE '/home/data.txt' INTO TABLE mytable
FIELDS TERMINATED BY ',' ENCLOSED BY '"' ";
The period concats were not needed.
9 matches
Mail list logo