been a long time since i done any SQL but i *think* you have to quote
single-quotes inside a string eg.

<snip>
$article     = "8852001100010";
$barcode     = "8852001100010";
$description = "BRAND'''S Essence of Chicken 42 cc.";

$strSQL = "INSERT INTO Product_Lookup_Table
(PL_Barcode,PL_Article,PL_Description) VALUES (";
$strSQL = $strSQL . "'" . $barcode . "','" . $article . "','" .$description
.. "')";


print $strSQL;
</snip>

try it, but i could be wrong :)

cheers

toby


> -----Original Message-----
> From: Andrew Hubbard [mailto:andrew@;pcs.co.th]
> Sent: Thursday, October 17, 2002 6:01 PM
> To: [EMAIL PROTECTED]
> Subject: Single Quote marks in a string
>
>
> Hi,
>       I'm having problems with a text file I'm working on. I
> need to get
> the descriptions in from the text file and into a
> string for use in an SQL statement however some of the
> descriptions use a
> single quote mark in the description.
> This of course stops the sql statement from working.
>
> How can I get around this? I don't want to remove the quote.
>
> Example is as follows
>
> 8852001100010,8852001100010,BRAND'S Essence of Chicken 42 cc.,0,TRUE
>
> $article = '8852001100010'
> $barcode = '8852001100010'
> $description = 'BRAND'S Essence of Chicken 42 cc.'
>
>
> $strSQL = "INSERT INTO Product_Lookup_Table
> (PL_Barcode,PL_Article,PL_Description) VALUES (";
>  $strSQL = $strSQL . "'" . $barcode . "','" . $article . "','" .
> $description . ")";
>
> I think this is relativly straight forward but I'm a newbie
> at Perl. - I
> wish I'd learnt it a few years ago now :)
>
> Regards
>
> Andrew Hubbard
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to