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::stringRobert Simmons28 Jan
  • Re: Convert mysqlpp::String to std::stringWarren Young28 Jan
    • Re: Convert mysqlpp::String to std::stringRobert Simmons28 Jan
      • Re: Convert mysqlpp::String to std::stringWarren Young28 Jan
        • RE: Convert mysqlpp::String to std::stringJeremy Rottman29 Jan
          • Re: Convert mysqlpp::String to std::stringRobert Simmons29 Jan