MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:jeremy brand Date:August 19 1999 8:07am
Subject:Re: ¦^ÂÐ: How to query a data
with 'backslash' in it?
View as plain text  
a pretty sure way would be to do this...

say the string you want is this.. 
"this would be the exact \ string \ i want";

for it to be a string it would have to look like this
"this would be the exact \\ string \\ i want";

so, maybe you could use addslashes() to whatever rutine you are using to
get the string.. 

other than that, i guess i'm still a bit unclear how a backslash would
differ.  

before you put anything in a table is is a good idea to do addslashes()..
that way you can escape any characters that would interupt the query.

i usually do, addslashes(stripslashes($stinrg)).. but in your case, maybe
you just want to do addslashes..

then when you get the data back out of the table, do a stripslashes()

..........................................................
.        Jeremy Brand  --  jeremy@stripped          .
.                     Care Mail, Inc.                    .
. tel:650.328.0198  fax:650.328.6442  efax:419.793.5233  .
..........................................................
.    Free e-mail and e-cards that help save wildlife!    .
.                http://www.care-mail.com/               .
..........................................................

On Thu, 19 Aug 1999 meng_chiu_lee@stripped wrote:

> Date: Thu, 19 Aug 1999 15:27:17 +0800
> From: meng_chiu_lee@stripped
> To: jeremy@stripped
> Cc: mysql@stripped
> Subject: [iso-8859-1]     in it?
> 
> >jeremy wrote:
> > "\a" will realy be stored in the table, but you will have to ask for '\\a'
> > again...
> thanks for your help,
> yes, so how can I select a data with backslash in it (the backslash is not for a
> binary byte, the is one character in the string), how can I retrieve that data from the
> table?
> I  used
> SELECT * from user1 where name like '\\a';
> in mySQL command line, but it didn't work..
> 
> I asked the question because in BIG5 Chinese encoding,
> there are some words have backslashes in them, which makes us hard to get the correct
> query result.
> 
> --------------------------------------------------------------------------
> > < 柵 侯 ネ > 

Thread
¦^ÂÐ: How to query a data with 'backslash' in it?meng_chiu_lee19 Aug
  • Re: ¦^ÂÐ: How to query a data with 'backslash' in it?jeremy brand19 Aug
    • Re: ¦^ÂÐ: How to query a data with 'backslash' in it?Scott Hess19 Aug