dbixx::result
This class is used as intermediate storage of query result.
Information About Query
unsigned long long rows(); unsigned int cols();
Return number of rows and columns in result.
dbixx::result res; sql<<"SELECT id FROM users"; sql.fetch(res); cout<<"There are "<<res.rows()<<" users"<<endl;
Fetching Rows
bool next(dbixx::row &r);
This function fetches next row from the result. If there
are no more rows to fetch, false
is returned.
For example:
dbixx::result res; dbixx::row r; sql<<"SELECT id,name FROM users",res; while(res.next(r)) { string name; int id; r >> id >> name; cout<<id<<":"<<name<<endl; }