[Gambas-user] problem with "&" and mysql
Andreas Fröhlke
afroehlke at ...784...
Thu Feb 9 09:33:58 CET 2006
Benoit Minisini schrieb:
> On Thursday 09 February 2006 08:14, Andreas Fröhlke wrote:
>
>>Charlie Reinl schrieb:
>>
>>>>Hello,
>>>>
>>>>I have a problem with mysql and the charakter "&". I like to use a
>>>>"INSERT"-statement with gambas like:
>>>>
>>>>INSERT INTO tabTest SET textfield='Hello & Bye' ;
>>>>
>>>>If I use this statement under phpmyadmin it will work, but with gambas
>>>>it raises an error. Only without the "&"-Charakter it work.
>>>>Please Help
>>>>
>>>>Thanks, A.Fröhlke
>>>>
>>>>P.S. Sorry for my bad english, I'm from germany ;)
>>>
>>>Salut,
>>>
>>>try it with && and think also that ' exists.
>>>
>>>Amicalment
>>>Charlie
>>>* Gesendet mit / Sent by: FEN-Webmail * http://www.fen-net.de *
>>>
>>>
>>>-------------------------------------------------------
>>>This SF.net email is sponsored by: Splunk Inc. Do you grep through log
>>>files for problems? Stop! Download the new AJAX search engine that
>>>makes searching your log files as easy as surfing the web. DOWNLOAD
>>>SPLUNK! http://sel.as-us.falkag.net/sel?cmd=k&kid3432&bid#0486&dat1642
>>>_______________________________________________
>>>Gambas-user mailing list
>>>Gambas-user at lists.sourceforge.net
>>>https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
>>Hi,
>>
>>It don't work. My "new" SQL-statement was:
>>
>>INSERT INTO tabTest SET textfield='Hello && Bye' ;
>>
>
>
> This should work there. What happens *exactly* ?
>
> The syntax of the substitution functions is a bit strange, I should change it
> maybe...
>
> At the moment, '&X' is replaced by the value of the X-th argument if X is a
> number of one or two digits greater than zero, and if not, it is replaced by
> 'X'.
>
> Regards,
>
>
Hello,
If I use the sql statement with gambas like this:
db.exec("INSERT INTO tabTest SET textfield='Hello & Bye' ;")
ERROR:
Query failed: You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to
use near 'Hello & Bye'' at line 1
also I tried:
db.exec("INSERT INTO tabTest SET textfield='Hello && Bye' ;")
ERROR:
Query failed: You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to
use near 'Hello && Bye'' at line 1
and:
db.exec("INSERT INTO tabTest SET textfield='Hello \\& Bye' ;")
ERROR:
Query failed: You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to
use near 'Hello \& Bye'' at line 1
but nothing work. Only it works if I delete the "&" charakter, but i
cant't do this, because than I must correct each userinput and correct
existing data with "&"-charakter in each table.
Please Help
Thanks A.Fröhlke
--
Mit freundlichen Grüßen aus Onsabrück.
Andreas Fröhlke
Anwendungsentwickler
KiKxxl GmbH
Mindener Str.127
49084 Osnabrück
Tel.: 0541 / 330 5 445
Fax: 0541 / 330 5 100
Mail: afroehlke at ...784...
WWW: http://www.kikxxl.de
More information about the User
mailing list