Re: Escaping nasty quotes
| From: | Matthew Vos | Date: | Thu, 31 Jul 2003 19:54:54 +0000 |
| Subject: | Re: Escaping nasty quotes | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-157801@lists.php.net to get a copy of this message | ||
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 "<br>$query2<br>";
>
> The query doesn't take ... but if I cut and paste the printed response into
> the mysql server manually ... works like a charm
>
> :-(
Try this:
$query = "LOAD DATA LOCAL INFILE '/home/data.txt' INTO TABLE mytable
FIELDS TERMINATED BY ',' ENCLOSED BY '\"' ";
It'll get rid of your parse error
Matt
Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc
Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc