#ifndef LIMONP_MYSQLCLIENT_H #define LIMONP_MYSQLCLIENT_H #include #include #include #include #include "logger.hpp" #include "vec_functs.hpp" namespace Limonp { using namespace std; class MysqlClient { public: typedef vector< vector > RowsType; private: const char * const HOST; const unsigned int PORT; const char * const USER; const char * const PASSWD; const char * const DB; public: MysqlClient(const char* host, uint port, const char* user, const char* passwd, const char* db): HOST(host), PORT(port), USER(user), PASSWD(passwd), DB(db){ _conn = NULL;}; ~MysqlClient(){dispose();}; public: bool init() { //cout< vec; for(uint i = 0; i < num_fields; i ++) { row[i] ? vec.push_back(row[i]) : vec.push_back("NULL"); } rows.push_back(vec); } mysql_free_result(result); return true; } private: MYSQL * _conn; }; } #endif