You should be able to do something as simple as this.
mysqlpp::String s = result[i];
std::string myString = std::string(s.data(),s.length());
From: Warren Young [mailto:mysqlpp@stripped]
Sent: Wednesday, January 28, 2009 3:24 PM
Subject: Re: Convert mysqlpp::String to std::string
On Jan 28, 2009, at 3:15 PM, Robert Simmons wrote:
> "String" isnt defined within <string> or <string.h>
I assumed when I wrote that that you would realize it needed either
"using namespace mysqlpp" or a "mysqlpp::" qualifier.
> Instead of returning "1;2;3;4;5" as it should in this case, the
> string only contains "1 - note the missing quote.
Given the data, I suspect the actual problem is that you didn't do the
quoting or escaping correctly when inserting it into the DB. Quotes
and semicolons are special characters in SQL. If you use something
like MySQL Query Browser to examine the table, I think you'll find
that it's truncated in the DB.
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsub=1