当前位置: 代码迷 >> Sql Server >> mysql++ Row输出有关问题。请问
  详细解决方案

mysql++ Row输出有关问题。请问

热度:92   发布时间:2016-04-27 11:48:27.0
mysql++ Row输出问题。请教
请问:
mysqlpp::Query query = con.query("select mycol from firsttable");
  if (mysqlpp::StoreQueryResult res = query.store()) {
  cout << "We have:" << endl;
  mysqlpp::StoreQueryResult::const_iterator it;
  for (it = res.begin(); it != res.end(); ++it) {
  mysqlpp::Row row = *it;
  cout << '\t' << row["mycol"] << endl; 这段代码与

mysqlpp::Query query = con.query(select mycol from firsttable");
  if(mysqlpp:UseQueryResult res = query.use()){
  cout<<"We have:"<<endl;  
  while(mysqlpp::Row row = res.fetch.row)
{ cout<<setw(30)<<row["id"]<<''
<<setw(9)<<row["password"]<<''
<<setw(9)<<row["displayname"]<<''
<<setw(9)<<row["permission"]<<''
<<setw(9)<<row["logtime"]<<''<<endl;
  }
  }
}
这两段代码效果是一样的吗?都是输出 关键字mycol 的所有数据行?
还有。代码中有错误或者 需要修改的地方也请明示。谢谢



------解决方案--------------------
可以去MYSQL版塊問問,管理菜單那裏可以自己移動帖子。
  相关解决方案