Initial commit
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
|
||||
#ifndef DatabasesH
|
||||
#define DatabasesH
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#include "../common/typedef.h"
|
||||
#endif
|
||||
|
||||
#include "mysql.h"
|
||||
#include<string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class Databases
|
||||
{
|
||||
public:
|
||||
Databases();
|
||||
~Databases();
|
||||
public:
|
||||
int InitMysql();
|
||||
int ConnectDatabases(char *IP, char *user, char *pass ,char *db);
|
||||
int CallPro(const char *call, char *select, MYSQL_ROW* row=NULL);
|
||||
int GetFieldData(int i, char *chData);
|
||||
int Query( char *query );
|
||||
my_ulonglong GetInsertID();
|
||||
int FreeResult();
|
||||
void CloseMysql();
|
||||
MYSQL_ROW GetRecord();
|
||||
int GetFieldNum(){ return m_nfieldNum; };
|
||||
|
||||
private:
|
||||
string m_strCall;
|
||||
string m_strSelect;
|
||||
|
||||
string m_srvIP;
|
||||
string m_userName;
|
||||
string m_password;
|
||||
string m_dbName;
|
||||
|
||||
int m_nfieldNum;
|
||||
|
||||
MYSQL_ROW m_record;
|
||||
MYSQL_RES *m_result;
|
||||
MYSQL m_mysql;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user