Re: Cleaning strings for SQL with WebCat
This WebDNA talk-list message is from 2005
It keeps the original formatting.
numero = 63676
interpreted = N
texte = Try to [url] the chars within the grep like:[grep search=3D[url]"[/url]&replace=3D[url]\"[/url]][cBody][/grep=]Nitai--eContentPark - Enterprise Digital Asset ManagementeServices - The complete SupportSuiteeSurvey - Online Questionnaire made easyRedakto CMS - Content Management that simply works ComputerOil=C2=AE AGNeugutstrasse 668600 D=C3=BCbendorf / SwitzerlandTelefon +41 (0)844 44 55 66 info@computeroil.comhttp://computeroil.com> -----Original Message-----> From: WebDNA Talk [mailto:WebDNA-Talk@talk.smithmicro.com] On B=ehalf Of> Adam O'Connor> Sent: Freitag, 23. Dezember 2005 20:24> To: WebDNA Talk> Subject: Re: Cleaning strings for SQL with WebCat> > Thanks Donovan. Doesn't [URL] mostly handle line breaks and sp=aces? I> guess my point is, what I am most concerned with is quotes, sin=gle> quotes, semi-colons, etc. Those type of characters are *legal*= within a> -url if I am not mistaken. That is why I thought perhaps [grep=] could> detect quotes and replace them with \" -which is compatible wit=h sql.> For some reason this didn't work, perhaps I am doing it wrong.> > I am trying to do something like this:> > ex:> cBody =3D "Hello World" , 'Hello World'> [text]cBody=3D[grep search=3D"&replace=3D\"][cBody][/grep] ---= look for> quotes and escape them> [text]cBody=3D[grep search=3D"&replace=3D\'][cBody][/grep] ---= look for> single quotes and escape them.> > Needed result: cBody =3D \"Hello World\" , \'Hello World\'> > Basically, look into the message body for quotes and single quo=tes and> escape them for the sql db. Seems like the above should work,=20=but it> doesn't.> > > > > > Donovan Brooke wrote:> > > Adam O'Connor wrote:> >> >> Can anyone tell me the general method on cleaning strings wi=th webcat> >> for preparation to sql. For instance, is there a webcat met=hod of> >> cleaning/escaping strings like php's clean() or .net's strin=g> >> cleaning? I have been working with [convertchars] and [grep=], but> >> still haven't been too sucessful. Figure if I would ask bef=ore> >> considering other methods, ie php, c#. Any help appriciated=..> >>> >> -thanks for answering my last question Nitai> >> >> >> > [url][/url]> >> > will create asc11 characters of the non-url compatible charac=ters..> >> > Donovan> >> >> >> > > -------------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list
.> To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to digest@talk.smithmicro.com>> Web Archive of this list is at: http://webdna.smithmicro.com/-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Associated Messages, from the most recent to the oldest:
Try to [url] the chars within the grep like:[grep search=3D[url]"[/url]&replace=3D[url]\"[/url]][cBody][/grep=]Nitai--eContentPark - Enterprise Digital Asset ManagementeServices - The complete SupportSuiteeSurvey - Online Questionnaire made easyRedakto CMS - Content Management that simply works ComputerOil=C2=AE AGNeugutstrasse 668600 D=C3=BCbendorf / SwitzerlandTelefon +41 (0)844 44 55 66 info@computeroil.comhttp://computeroil.com> -----Original Message-----> From: WebDNA Talk [mailto:WebDNA-Talk@talk.smithmicro.com] On B=ehalf Of> Adam O'Connor> Sent: Freitag, 23. Dezember 2005 20:24> To: WebDNA Talk> Subject: Re: Cleaning strings for SQL with WebCat> > Thanks Donovan. Doesn't [url] mostly handle line breaks and sp=aces? I> guess my point is, what I am most concerned with is quotes, sin=gle> quotes, semi-colons, etc. Those type of characters are *legal*= within a> -url if I am not mistaken. That is why I thought perhaps [grep=] could> detect quotes and replace them with \" -which is compatible wit=h sql.> For some reason this didn't work, perhaps I am doing it wrong.> > I am trying to do something like this:> > ex:> cBody =3D "Hello World" , 'Hello World'> [text]cBody=3D[grep search=3D"&replace=3D\"][cBody][/grep] ---= look for> quotes and escape them> [text]cBody=3D[grep search=3D"&replace=3D\'][cBody][/grep] ---= look for> single quotes and escape them.> > Needed result: cBody =3D \"Hello World\" , \'Hello World\'> > Basically, look into the message body for quotes and single quo=tes and> escape them for the sql db. Seems like the above should work,=20=but it> doesn't.> > > > > > Donovan Brooke wrote:> > > Adam O'Connor wrote:> >> >> Can anyone tell me the general method on cleaning strings wi=th webcat> >> for preparation to sql. For instance, is there a webcat met=hod of> >> cleaning/escaping strings like php's clean() or .net's strin=g> >> cleaning? I have been working with [convertchars] and [grep=], but> >> still haven't been too sucessful. Figure if I would ask bef=ore> >> considering other methods, ie php, c#. Any help appriciated=..> >>> >> -thanks for answering my last question Nitai> >> >> >> > [url][/url]> >> > will create asc11 characters of the non-url compatible charac=ters..> >> > Donovan> >> >> >> > > -------------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list .> To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to digest@talk.smithmicro.com>> Web Archive of this list is at: http://webdna.smithmicro.com/-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
"Nitai @ ComputerOil"
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
webcat2b12 CGI -- Date comparisons (1997)
WebCat2 beta 11 - new prefs ... (1997)
Looping a variable name with [index] (1999)
b18 problem on NT 4.0 (1997)
[carts] and databases (1997)
Re:emailer 150 (1997)
Multiple SSL Keys (1998)
AAgghh!! Help, please. SSL strikes again. (1997)
Message Board (1998)
WebCat2b13MacPlugIn - [showif][search][/showif] (1997)
Cobalt (2002)
If Empty ? (1997)
Hiding HTML and page breaks (1997)
Can you do this??? and other stuff (1997)
cart (1997)
Stinkin' [Referrer] (1998)
Browser Reloads and AddlineItem (1997)
[MATH] and Dates (1998)
Limiting user access to .tmpl files (1997)
off-topic - printinglib 68K (1997)