db_bridge/mysql_db.cpp
changeset 15 5a0ca1f9a2f1
parent 14 862d63715611
child 17 b3731a25b9ec
equal deleted inserted replaced
14:862d63715611 15:5a0ca1f9a2f1
    35 Abstract_DB::DB_RESULT MySQL_DB::query (std::string sql_string)
    35 Abstract_DB::DB_RESULT MySQL_DB::query (std::string sql_string)
    36 {
    36 {
    37     Abstract_DB::DB_ROW vec;
    37     Abstract_DB::DB_ROW vec;
    38     Abstract_DB::DB_RESULT rows;
    38     Abstract_DB::DB_RESULT rows;
    39     MYSQL_ROW row;
    39     MYSQL_ROW row;
    40     int i;
    40     int i = 0;
    41 
    41 
    42     /*
    42     /*
    43      * send SQL query
    43      * send SQL query
    44      */
    44      */
    45     if (mysql_query (conn, sql_string.c_str ())) {
    45     if (mysql_query (conn, sql_string.c_str ())) {
    59         }
    59         }
    60         rows.push_back (vec);
    60         rows.push_back (vec);
    61         vec.clear ();
    61         vec.clear ();
    62     }
    62     }
    63 
    63 
       
    64     std::cerr << "Die Abfrage hat " << i << " Spalte(n) und " << rows.size () << " Reihe(n)." << std::endl;
       
    65 
    64     if (res != NULL) {
    66     if (res != NULL) {
    65         mysql_free_result (res);
    67         mysql_free_result (res);
    66     }
    68     }
    67 
    69 
    68     return rows;
    70     return rows;