dbTalk Databases Forums  

Error in User Manual?

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss Error in User Manual? in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Kim Rasmussen
 
Posts: n/a

Default Error in User Manual? - 09-28-2005 , 06:21 AM






Hi!

I'm pretty new to MySql++ so please forgive me if I've overlooked
something. Here's my problem.

In Section 2.3, "Queries That Return Data: Dynamic Method" of the User
Manual (as on
http://tangentsoft.net/mysql++/doc/u.../overview.html) the
following is stated:

Quote:
The easiest way to retrieve data from MySQL uses a Result object,
which includes one or more Row objects. Because these classes are
std::vector-like containers, you can treat the result set as a
two-dimensional array. For example, you can get the 5th item on the
2nd row by simply saying result[1][4]. You can also access row
elements by field name, like this: result[2].lookup_by_name("price").
But as far as I can tell the Result object doesn't even supply an
operator[] and if I try to use the "result[][]" notation I get a compile
error ("error: no match for 'operator[]' in 'result[0]').

So, what's the right way? Should I do "result.at(0)[0]" instead?

I'm using MySql++ 2.0.5.

Thanks.

-Kim




--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #2  
Old   
Warren Young
 
Posts: n/a

Default Re: Error in User Manual? - 09-28-2005 , 07:34 AM






Kim Rasmussen wrote:
Quote:
Should I do "result.at(0)[0]" instead?
Yes, that's the new syntax.

I'll fix the error in the next version.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #3  
Old   
Kim Rasmussen
 
Posts: n/a

Default Re: Error in User Manual? - 09-28-2005 , 07:58 AM



Warren Young wrote:

Quote:
Should I do "result.at(0)[0]" instead?


Yes, that's the new syntax.

I'll fix the error in the next version.

Okay, thanks a lot.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #4  
Old   
Bernd Prager
 
Posts: n/a

Default Re: Error in User Manual? - 09-30-2005 , 01:34 PM



Kim Rasmussen wrote:
Quote:
Warren Young wrote:


Should I do "result.at(0)[0]" instead?


Yes, that's the new syntax.

I'll fix the error in the next version.

Okay, thanks a lot.

This returns a "ambiguous overload for 'operator[]' in
'mysqlpp::Result::at(unsigned int) const(0u)[0]" error for me.
Though "result.at(0).at(0)" made it work.

I'm using mysql++-2.0.5.

-- Bernd

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.