source: network-game/server/DataAccess.h@ 371ce29

Last change on this file since 371ce29 was 59061f6, checked in by dportnoy <dmp1488@…>, 12 years ago

Added new data access methods to save and retrieve player data

  • Property mode set to 100644
File size: 474 bytes
Line 
1#ifndef _DATA_ACCES_H
2#define _DATA_ACCESS_H
3
4#include <string>
5
6#include <mysql/mysql.h>
7
8#include "Player.h"
9
10using namespace std;
11
12class DataAccess {
13public:
14 DataAccess();
15 ~DataAccess();
16
17 int insertPlayer(string username, string password);
18
19 Player *getPlayer(string username);
20 int printPlayers();
21
22 int insert(string table, string rows, string values);
23 MYSQL_RES *select(string table, string filter);
24
25private:
26 MYSQL *connection, mysql;
27};
28
29#endif
Note: See TracBrowser for help on using the repository browser.