Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous message
Novo is currently offline  Novo
Messages: 1430
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
 
Read Message
Read Message
Previous Topic: postgresql mingw
Next Topic: Sqlite join from select
Goto Forum:
  


Current Time: Sat Jun 07 16:39:23 CEST 2025

Total time taken to generate the page: 0.10457 seconds