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:

Has anyone built this already? (2003) Date problems-more (1997) Re requiredFields parameter (1998) Protecting webdelivery (1997) Using Applescript to process WebCatalog functions (1998) Add all products to cart at once? (1997) WebCatalog [FoundItems] Problem - LONG - (1997) Encrypt/Decrypt (2007) Adding order weight (1999) authenticating a second user (1997) How does WebCatalog search the database? (1997) Protect (1997) Multiple fields on 1 input (1997) WebDNA-Talk Digests (1997) [shownext] and descending order (1997) find with exceptions (1997) and vs or vs not (1998) Doctype (2004) Location of Webcat site in folder hierarchy (1997) WebCat2b13MacPlugIn - [include] doesn't allow creator (1997)