Oh! Thanks!
On Thu, Dec 30, 2010 at 2:38 PM, Warren Young <mysqlpp@stripped> wrote:
> On 12/30/2010 1:52 PM, Chris Morgan wrote:
>
>>
>> If you want the number of columns in a particular mysqlpp::Row, you
>> need to use myslqpp::Row::size()
>>
>
> That, or you can check with the result set object:
>
> mysqlpp::StoreQueryResult res = query.store();
> cout << "Columns: " << res.num_fields() << endl;
>
> mysqlpp::StoreQueryResult myresultset = query.store();
>>
>> for (unsigned int i = 0; i< myresultset.num_rows(); i++)
>> {
>> std::cout<< "Row "<< i<< " Size: "<<
> myresultset[i].size()<<
>> std::endl;
>> }
>>
>
> No need to check each row. They'll all have the same number of columns.
> Each Row object refers back to the ResultBase derivative that created it
> for things like column information, so they can't be mismatched.
>
> --
> MySQL++ Mailing List
> For list archives: http://lists.mysql.com/plusplus
> To unsubscribe:
> http://lists.mysql.com/plusplus?unsub=1
>
>