From: Jonathan W. <co...@co...> - 2003-11-06 14:49:57
|
On Thu, Nov 06, 2003 at 01:53:03PM +0100, Wolfgang Gutjahr wrote: > in order to be able to use the mysql_real_escape_string() function, I > need the MYSQL pointer of the connection, but it is private in the > Connection class and the obj() function to get it is outcommented. Yes. > Is there a possibility to get the pointer or another way to call > mysql_real_escape_string() (without opening another connection)? Good question! :-) I might be missing something (i'm still new to the source myself) but there should probably be a Connection::escape_string() function that uses the Connection's MYSQL*. The only place in mysqlcppapi that escapes a string uses mysql_escape_string() so doesn't need the MYSQL* (and doesn't respect the current character set) Murray, I'll prepare a patch that adds an escape_string() or escape() function (any preference of name?) as I already have something similar in my mysql wrapper. Some other DB API wrappers I've seen provide an escape_string_literal() function that escapes a string and encloses it in quotes, but I think this is redundant - how hard is it to add quotes manually? jon -- "MTV Awards - a bunch of rich people showing off and getting patted on the back for stuff that they should be doing anyway." - Method Man |