From: Warren Young Date: August 21 2008 9:24am Subject: Re: A way to copy mysqlpp::StoreQueryResult into a std::map? List-Archive: http://lists.mysql.com/plusplus/7894 Message-Id: <48AD3443.2050308@etr-usa.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Alex wrote: > > So you can understand that I wouldn't be able to directly refer to the > specific command the user wants help for as the vector is split up in > numbers. I understand no such thing. The answer is simple either way: Query q = conn.query("SELECT * FROM command WHERE NAME ="); q << quote << myCommandName; StoreQueryResult res = q.store(); if (res) { // have help for this command } else { // don't have help for this command } Or: class command { public: command(const char* name, const char* help = 0, const char* syntax = 0) : name_(name), help_(help ? help : ""), syntax_(syntax ? syntax : "") { } .... bool operator==(const command& rhs) { return name_ == rhs.name_; } private: string name_, help_, syntax_; }; vector vc; // populate vector of command objects somehow vector::iterator it = find(vc.begin(), vc.end(), command(myCommandName)); if (it != vc.end()) { // have help for this command } else { // don't have help for this command } So, is this a homework problem, or what?