我讀過的教程中,我一般得到的是如何工作的: http://tangentsoft.net/mysql++/doc/html/userman/tutorial.html#simple問題用mysql ++庫
我想建立這個MySQL ++代碼,我得到一個錯誤:
std::ostringstream query3;
query3<<"select pipe_id from pipe where version_id='"<<id<<"'";
std::storeQueryResult ares=query3.store();
for(size_t i=0;i<ares.num_rows();i++)
cout<<ares[i]["version_id"]<<ares[i]["pipe_id"]<<std::endl;
mysql_query(&mysql,query3.str().c_str());
錯誤是store
不是ostringstream
的成員。我不知道如何解決問題。
Merlyn嗨,
感謝您的代碼,看着我的問題。
我試圖上面的代碼,但再次我正在錯誤
錯誤:請求部件「連接」「查詢」,其是非類類型「MYSQL *」
在這條線的代碼
// Construct a query object with the query string mysqlpp::Query query =
connection.query(query_string);
請問哪裏有問題?
請編輯您的代碼,使其看起來像真正的C++代碼。 – Arkadiy 2010-09-23 19:38:27
請嘗試更清楚您想要做什麼以及您的實際問題是什麼。 – 2010-09-23 21:31:52
根據他以前的問題編輯該問題。 – 2010-09-23 21:45:55