| List: | MySQL++ | « Previous MessageNext Message » | |
| From: | Robert Simmons | Date: | January 28 2009 12:40pm |
| Subject: | Convert mysqlpp::String to std::string | ||
| View as plain text | |||
Hello All,
I am currently working on an application using MySQL++ and I need to
convert a returned value back to a std::string in order to perform
subsequent operations on it. The current code below (also tried with a
normal cast) simply puts the first character of the MySQLpp::String
into the variable, rather than the whole string. Can someone point out
what I've missed here?
if (mysqlpp::StoreQueryResult clusters = query.store())
{
for (int i = 0; i < clusters.num_rows(); ++i)
{
string servers(clusters[i]["servers"]); //servers => "1
}
}
Cheers,
Robert Simmons
| Thread | ||
|---|---|---|
| • Convert mysqlpp::String to std::string | Robert Simmons | 28 Jan |
| • Re: Convert mysqlpp::String to std::string | Warren Young | 28 Jan |
| • Re: Convert mysqlpp::String to std::string | Robert Simmons | 28 Jan |
| • Re: Convert mysqlpp::String to std::string | Warren Young | 28 Jan |
| • RE: Convert mysqlpp::String to std::string | Jeremy Rottman | 29 Jan |
| • Re: Convert mysqlpp::String to std::string | Robert Simmons | 29 Jan |
