Re: [Gambas-user] MySQL query problems with apostropies

2010-04-07 Thread Keith Clark
On Wed, 2010-04-07 at 21:55 +0200, Fabien Bodard wrote: > 2010/4/7 Keith Clark : > > On Wed, 2010-04-07 at 14:40 -0500, nando wrote: > >> Replace will work for quote and backslash > >> For double quote: > >> > >> doublequote$ is chr$(34) > >> Replace$(mystring, chr$(34), "\" & chr$(34) > >> > >> Bu

Re: [Gambas-user] MySQL query problems with apostropies

2010-04-07 Thread Keith Clark
On Wed, 2010-04-07 at 14:40 -0500, nando wrote: > Replace will work for quote and backslash > For double quote: > > doublequote$ is chr$(34) > Replace$(mystring, chr$(34), "\" & chr$(34) > > But, Benoit had an email of the nice solution. > -Fernando > > Ok, I've tried this: DescriptionTe

Re: [Gambas-user] MySQL query problems with apostropies

2010-04-07 Thread Keith Clark
> did you understand how subst() function work ijn gambas ?? > > mystring = subst("this is my &1 &2", "black", "dog") > > print mystring give : > > this my black dog > > &1 and &2 are replaced by subst param > > for the sql queries it work at the same ... but with an automatic escaping. > so t

Re: [Gambas-user] MySQL query problems with apostropies

2010-04-07 Thread Fabien Bodard
2010/4/7 Keith Clark : > On Wed, 2010-04-07 at 14:40 -0500, nando wrote: >> Replace will work for quote and backslash >> For double quote: >> >> doublequote$ is chr$(34) >> Replace$(mystring, chr$(34), "\" & chr$(34) >> >> But, Benoit had an email of the nice solution. >> -Fernando > > I did not un

Re: [Gambas-user] MySQL query problems with apostropies

2010-04-07 Thread Keith Clark
On Wed, 2010-04-07 at 14:40 -0500, nando wrote: > Replace will work for quote and backslash > For double quote: > > doublequote$ is chr$(34) > Replace$(mystring, chr$(34), "\" & chr$(34) > > But, Benoit had an email of the nice solution. > -Fernando > I don't think this works. This is what I ge

Re: [Gambas-user] MySQL query problems with apostropies

2010-04-07 Thread Keith Clark
On Wed, 2010-04-07 at 14:40 -0500, nando wrote: > Replace will work for quote and backslash > For double quote: > > doublequote$ is chr$(34) > Replace$(mystring, chr$(34), "\" & chr$(34) > > But, Benoit had an email of the nice solution. > -Fernando I did not understand that solution either.

Re: [Gambas-user] MySQL query problems with apostropies

2010-04-07 Thread nando
iling list for gambas users Sent: Wed, 07 Apr 2010 15:33:12 -0400 Subject: Re: [Gambas-user] MySQL query problems with apostropies > On Tue, 2010-04-06 at 16:27 -0500, nando wrote: > > Strings that contain these three characters: quote, double quote and > > backslash > > need

Re: [Gambas-user] MySQL query problems with apostropies

2010-04-07 Thread Keith Clark
On Tue, 2010-04-06 at 16:27 -0500, nando wrote: > Strings that contain these three characters: quote, double quote and backslash > need to be escaped. > You escape them by having a backslash immediately before it. > Example: > Patty O'Lantern would be... > Patty O\'Lantern > > One way is to mak

Re: [Gambas-user] MySQL query problems with apostropies

2010-04-06 Thread BenoƮt Minisini
> Strings that contain these three characters: quote, double quote and > backslash need to be escaped. > You escape them by having a backslash immediately before it. > Example: > Patty O'Lantern would be... > Patty O\'Lantern > > One way is to make a small function that will insert a backslash

Re: [Gambas-user] MySQL query problems with apostropies

2010-04-06 Thread nando
base will not return the 'escape' backslash. It will appear normal. Please note: / (on the question mark key) is not the backslash. \ is the backslash. -Fernando -- Original Message --- From: Keith Clark To: gambas-user@lists.sourceforge.net Sent: Tue, 06 Apr 2

[Gambas-user] MySQL query problems with apostropies

2010-04-06 Thread Keith Clark
I have the following code: $Query = "" QueryArray[0] = "insert into products_description" QueryArray[1] = "(products_id,language_id,products_name,products_description,products_format)" QueryArray[2] = "values (" & NewProductID & ",1,'" & TitleTextBox.Text & "','" & DescriptionTextArea.Text & "',"