1 #ifndef __MYSQL__H_DB__
2 #define __MYSQL__H_DB__
6 #include <sys/socket.h>
13 #include "Exception.h"
17 class MySQLException : public DatabaseException
20 MySQLException(std::string szErrorMessage, unsigned int nErrorCode) : DatabaseException(szErrorMessage, nErrorCode) { }
23 class MySQL : public CDatabase
27 MYSQL_RES *m_LastResult;
30 std::string m_Servername, m_Username, m_Password, m_Database;
34 MySQL(std::string Servername, std::string Username, std::string Password, std::string Database, int Port = 0);
39 void Query(std::string SQLQuery);
40 uint64 Select(std::string SQLQuery);
41 int SelectUnbuffered(std::string SQLQuery);
42 int Fetch(); // TRUE is more data is available
43 void OpenDatabase(std::string Servername, std::string Username, std::string Password, std::string Database, int Port = 0);
44 int GetInt(int Column);
45 __int64 GetInt64(int Column);
46 __int64 GetLastInsertID();
47 __int64 GetAffectedRows();
48 const unsigned char* GetText(int Column);
49 void Escape(std::string&);