Drew M.: I am actually storing the results with the query.store() call, and after all, I
am not using another query object, and I am not sending another query to execute. Only
one query is to be executed.
Warren Young: I have caught the exception. The exceptions what() returns the same error as
Commands out of sync; you can't run this command now.
"If it's not an exception, it may be that you're mixing a library built
with one build setup with an executable built another way. That's a
pretty good way to crash a program."Yes. I actually am mixing another library. Its
WxWidgets, but I have checked and I'm using the right build setups (If you mean
release/debug). Apart from that, WxWidgets is compiled in UNICODE. Maybe that could have
something to do with it.
Ive updated the code to make it a bit clearer:
mysqlpp::Query query = con.query();
query.execute("SELECT * FROM eqdkp_news");
ofin << "Query wasn't succesfull: " << query.error() << std::endl;
res = query.store();
catch (mysqlpp::Exception &e)
ofin << "exception" << e.what() << " end\n\n";
while (row = res.fetch_row())
// Probably need to use utf8trans but irrelevant for now.
ofin << row["news_headline"];
ofin << row["news_message"];
ofin << row["news_id"];
ofin << row["news_date"];
ofin << row["user_id"];
ofin << "else: " << query.error() << std::endl;