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 Management eServices - The complete SupportSuite eSurvey - Online Questionnaire made easy Redakto CMS - Content Management that simply works ComputerOil=C2=AE AG Neugutstrasse 66 8600 D=C3=BCbendorf / Switzerland Telefon +41 (0)844 44 55 66 info@computeroil.com http://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:

    
  1. Re: Cleaning strings for SQL with WebCat ( "Adam O'Connor" 2005)
  2. Re: Cleaning strings for SQL with WebCat ( "Nitai @ ComputerOil" 2005)
  3. Re: Cleaning strings for SQL with WebCat ( "Adam O'Connor" 2005)
  4. Re: Cleaning strings for SQL with WebCat ( Donovan Brooke 2005)
  5. Cleaning strings for SQL with WebCat ( "Adam O'Connor" 2005)
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 Management eServices - The complete SupportSuite eSurvey - Online Questionnaire made easy Redakto CMS - Content Management that simply works ComputerOil=C2=AE AG Neugutstrasse 66 8600 D=C3=BCbendorf / Switzerland Telefon +41 (0)844 44 55 66 info@computeroil.com http://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:

WebCatalog/Mac 2.1b2 New Features (1997) Nested tags count question (1997) 2.0Beta Command Ref (can't find this instruction) (1997) Search returns all, not 20 (1997) Credit Card Number Stripping Digit (1997) Unique value creation (1999) no [search] with NT (1997) Cart questions (1997) t or f (1997) [delete] problem (1997) Digest for 09-30-97 (1997) passing search criteria (1997) Mult-File Upload w/ Web Star (2000) Logging purchases (1997) Search Multiple databases (2005) creating writefile data from a nested search (1997) Q on the best way to set up a security function so users can edit records (1999) (no subject) (2000) Upload Progress Bar (2003) [UPPERCASE] (1997)