⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 g_dbmysql.h

📁 mysql数据库的数据存储类的实现
💻 H
字号:
/*
g_dbmysql.h: interface for the CG_DBMySql class.
*/

#ifndef __CG_DB_MYSQL_H__
#define __CG_DB_MYSQL_H__

#include "g_platform.h"
#include <mysql.h>

class CG_DBMySql  
{
public:
	unsigned long GetInsertId();
	long  GetAffectedRows();
	bool  Query(const char *sql,int len=0);
	bool  Connect(const char *host,int port,const char *name,const char *pwd,const char *db);
	bool  GetField(int idx,char *field,int *type,char **value);
	bool  GetFieldContent(int nIdx , int *pnType , char **ppValue);
    bool  GetRow();
	void  SetLog(bool log);
	void  ShowError();
	void  Close();
	int   GetFieldInfo(int nIdx, char *pszName);
    int   GetRowCount();
	int   GetFieldCount();
	char *GetField(char *fname,int *len = NULL);
    
	CG_DBMySql();
	virtual ~CG_DBMySql();
	
private:
	bool		 m_log;
	MYSQL		*m_handle;
	MYSQL_RES	*m_res;
	MYSQL_ROW	 m_row;
	MYSQL_FIELD *m_fields;
	int          m_fieldCnt;
};

#endif 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -