Home » U++ Library support » U++ SQL » Escape string in MySQL
|
Re: Escape string in MySQL [message #51824 is a reply to message #51820] |
Sat, 08 June 2019 17:01 |
Novo
Messages: 1371 Registered: December 2006
|
Ultimate Contributor |
|
|
You shouldn't embed your string into an SQL statement. Use parameters instead. Example (Sqlite):
String oc_name = "Can't do that";
Sql sel(dbs);
sel.SetStatement("SELECT id FROM lemma WHERE oc_name = ?");
sel.Run(oc_name);
Another useful method to use is Sql::SetParam.
Regards,
Novo
|
|
|
Goto Forum:
Current Time: Fri Sep 20 20:39:04 CEST 2024
Total time taken to generate the page: 0.03437 seconds
|