[Gambas-user] Characters with ~ or ' not saved correctly in MySQL
Benoit Minisini
gambas at ...1...
Mon Aug 7 14:35:48 CEST 2006
On Monday 07 August 2006 14:22, Fabricio Silva wrote:
> This is a strange behavior the happens only if I save data in MySQL using
> gambas. For example using gambas the word "Goiás" is stored "Goiás" in
> database. Using phpmyadmin to insert data the word "Goiás" is saved
> correctly. I'm using this code:
> .rs = .db.Exec("insert into employes values( ' " & txtname.text & "
> ',' " & txtaddress.Text & " ')")
>
Another point. Never insert something this way into the database, this is a
true fortune for crackers.
Gambas offers facilities to correctly quote strings inserted into a database:
.db.Exec("insert into employes values(&1,&2)", txtName.Text, txtAddress.Text)
Regards,
--
Benoit Minisini
More information about the User
mailing list