[Gambas-user] How to input quotation mark in TextBox.Text to mysql

Jack jscops at ...11...
Wed Apr 29 13:47:13 CEST 2009


Le mercredi 29 avril 2009 13:24:47 webs37, vous avez écrit :
> Hi all,
>
> Please help.., I have error message:"Query failed: You have an error in SQL
> syntax, check the manual that corresponds to MySQL server version for the
> right syntaxto use near 'an',address='Saudi Arabia"
>
> I want to input text that have a quotation mark like "al Qur'an"
>
> here these the syntax:
>
> syntax "edit = "UPDATE tbl_user set title='" & TextBox32.Text &
> "',publisher='" & TextBox35.Text & "',year='" & TextBox33.Text &
> "',volume='" & TextBox39.Text & "',colation='" & ComboBox14.Text &
> "',isbn='" & TextBox53.Text & "',city='" & an1!id_city & "',publisher='" &
> ana3!id_log & "',subject='" & an2!id_log & "',distribution='" & ana4!id_log
> & "',hp='" & TextBox36.Text & "',status='" & Label159.Caption & "' WHERE
> id='" & Label92.Caption & "'"
> rsedit = connection.Exec(edit)"

use this syntax.

Connexion.Exec("UPdate  tbl_user  SET  title = &1, publisher = &2, year = &3, 
status = &4 where id = &5", TextBox32.Text , TextBox35.Text, TextBox33.Text, 
Label159.Caption,  Label92.Caption)

Jack






More information about the User mailing list