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:

Setting up WebCatalog with Retail Pro data (1996) Users.db [encrypt seed=????] (1998) WebCat2b13MacPlugIn - syntax to convert date (1997) Error Lob.db records error message not name (1997) PC Authorize & Webmerchant (1998) HELP WITH DATES (1997) WebDNA Solutions ... sorry! (1997) Show shoppingcart after remove last item (1997) PIXO Support (1997) Questions To Answer (1997) Upgrading from version (1998) set header in DB (no cart) (2003) Server crash (1997) WebCatalog + Linux + ODBC + Oracle ! ? (2000) I found a bug ... (1997) More on the email templates (1997) Make sure I understand this??? (1997) Generating unique SKU from [cart] (1997) Orders w/in [sendmail] (1998) What is WebDNA (1997)