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:

Problems getting parameters passed into email. (1997) WC2f3 (1997) State Coalition Approves Internet Sales Tax Plan (2002) LetterRip and WebCat & more (1998) Updating fields from different platforms (1998) [WebDNA] Sort by Row (2017) WebCat2 beta 11 - new prefs ... (1997) multiple search commands (1997) japanese characters (1997) No luck with taxes (1997) canEmail? (1998) Email (1998) Press Release hit the NewsWire!!! (1997) flushdatabases (1997) ANNOUNCE: FREE ProcessWatch Webmaster utility (1998) [sendmail] questions... (1997) Image maps/Webcat (1997) WebCat2b13 Mac plugin - [sendmail] and checkboxes (1997) PCS Frames (1997) Searching a field and returning the highest value (1997)