From: Joel Fielder Date: August 26 2008 10:03am Subject: Re: A way to copy mysqlpp::StoreQueryResult into a std::map? List-Archive: http://lists.mysql.com/plusplus/7921 Message-Id: <48B3D4E7.4080706@switchplane.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sorry, thought you were talking about the test of the result object rather than parameters to your logging function! But, what I said is still valid as your problem is that "even if there's no help data for the command the user requests help for, res_help_cmd returns true". What you describe is the correct behaviour for mysql++. Sometimes it is perfectly ok to have no results found, e.g. "get the customers who have bought a certain product in the last week" - there might not be any, but that is still the correct answer and should not throw an exception or be treated as an error condition. As there was no error with the query, a boolean test of res_help_cmd will return true. You should call num_rows to find out if there is data available and only log if that is the case. Look at examples/simple1.cpp. Alternatively, use for_each. Joel Alex wrote: > Well, in a previous answer, Warren used that if-statement and it > worked fine. As for those true/false: they're part of my slog.clog > function and really doesn't have anything to do with SQL. > >