List:MySQL++« Previous MessageNext Message »
From:Alex Date:August 22 2008 5:46pm
Subject:Re: A way to copy mysqlpp::StoreQueryResult into a std::map?
View as plain text  
After debugging the code a bit, I tried this:

                mysqlpp::Query qry_help_cmd = mysql_conn.query();
                qry_help_cmd << "SELECT `name`,`syntax`,`help` FROM
`command` WHERE name = "
                                << quote << command_tokens[1];
                mysqlpp::StoreQueryResult res_help_cmd = qry_help_cmd.store();
                if(res_help_cmd){
std::cout << 1 << endl;
                        slog.clog("Name: " + res_help_cmd[0]["name"]);
                        slog.clog("Syntax: " + res_help_cmd[0]["syntax"]);
                        slog.clog("Description: " + res_help_cmd[0]["help"]);
std::cout << 2 << endl;
                }else{
                        slog.clog("No help available for " +
command_tokens[1] + ".");
                };

It only shows 1. 2 is not sent to the output. That should mean it
can't print the vars above for some reason.. Here's the slog.clog
code:

                void clog(string clog_text){
                        std::cout << "-- " << cur_time() << clog_text
<< endl;
                        if(awi_config[1][0] == "true"){
                                ofstream
log_file(awi_config[1][1].c_str(),ios::app);
                                if(!log_file.is_open()){
                                        std::cout << "-> ERROR: Failed
to open log file." << endl;
                                }else{
                                        log_file << cur_time() <<
clog_text << endl;
                                };
                                log_file.close();
                        };
                };

So.. I can't really seem to figure where in this code I'm doing it wrong. ;)

-- You may so assume.  You may be wrong, or you may not. :)

I'm an optimist. :D

2008/8/22 Warren Young <mysqlpp@stripped>:
> Alex wrote:
>>
>> I'm assuming this bug will be fixed in 3.0.7?
>
> You may so assume.  You may be wrong, or you may not. :)
>
>> "info" incompatible with "i" type
>
> It means you're trying to convert a mysqlpp::String to int somewhere and
> it's not having it because the content of the string isn't an integer. Find
> out which line the exception is being thrown from, and that will tell you
> where you've got your types wrong.
>
> --
> MySQL++ Mailing List
> For list archives: http://lists.mysql.com/plusplus
> To unsubscribe:    http://lists.mysql.com/plusplus?unsub=1
>
>



-- 
GamerzWoW - http://www.gamerzwow.net
Thread
A way to copy mysqlpp::StoreQueryResult into a std::map?Alex13 Aug
  • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Warren Young13 Aug
    • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex13 Aug
      • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Warren Young13 Aug
        • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex14 Aug
          • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex17 Aug
            • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Warren Young17 Aug
              • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex19 Aug
                • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Warren Young19 Aug
                  • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex20 Aug
                    • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Warren Young21 Aug
                      • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex21 Aug
                        • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Warren Young21 Aug
                          • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex21 Aug
                            • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex22 Aug
                              • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Warren Young22 Aug
                                • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex22 Aug
                                  • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Warren Young22 Aug
                                    • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex22 Aug
                                      • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex22 Aug
                                      • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Warren Young22 Aug
                                        • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex22 Aug
                                          • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Warren Young22 Aug
                                            • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex25 Aug
                                              • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Joel Fielder26 Aug
                                                • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex26 Aug
                                                  • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Joel Fielder26 Aug
                                                    • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex26 Aug
                                                  • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Warren Young26 Aug
                                                    • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex27 Aug