[Gambas-user] HTML comtent in MySQL query.

Benoît Minisini gambas at ...1...
Sun Mar 31 20:19:21 CEST 2013


Le 31/03/2013 19:17, Charlie Reinl a écrit :
> Am Sonntag, den 31.03.2013, 09:47 -0700 schrieb abbat81:
>> I'm sorry, but I don't understand.
>>
>> <http://gambas.8142.n7.nabble.com/file/n41538/2013-03-31-194503_1680x1050_scrot.png>
>>
>> I have problem with quotes.
>
> Hallo,
>
> yes
> 	Qry="<table width='650'></table>"
>
> set to "UPDATE users SET login = '" & Qry & "'"
> gives you "UPDATE users SET login = '<table width='650'></table>'"
>
> behind the = you have '<table width=' and '></table>' and a 650 in the
> middle.
>
> try
> DConnect.$Con.Exec("UPDATE users SET login = &1",Qry)
> or
> DConnect.$Con.Exec("UPDATE users SET login = '" & replace(Qry,"'","''")
> & "'")
>

You should use the Gambas quoting facilities instead:

	DConnect.$Con.Exec("UPDATE users SET login = &1", Qry)

Easier, isn't it?

-- 
Benoît Minisini




More information about the User mailing list