-
Notifications
You must be signed in to change notification settings - Fork 0
/
Mysql.h
51 lines (42 loc) · 1.18 KB
/
Mysql.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef _MYSQL_H_
#define _MYSQL_H_
#include <iostream>
#include <stdlib.h>
#include <mysql/mysql.h>
#include <stdio.h>
#include <string.h>
#define MAX_SQL_LEN (4096)
#define SUM_SQL_LEN (200*(MAX_SQL_LEN))
using namespace std;
class Mysql{
public:
Mysql();
~Mysql();
int add_user(char user_info[8][512]);
int select_user_store(char* sql,char *user_info);
int delete_user(char *name);
int select_users_name(char **p);
int select_user(char* acnt,char* user_info = NULL);
int update_user(char user_info[8][512]);
int update_privilege(char *str);
int select_privilege(char *str);
int add_role(char *role,char *privi);
int delete_role(char *role);
int update_role(char *role,char *privi);
int select_role(char *role,char *privi = NULL);
int select_role_store(char *sql,char *role_info);
int select_roles_name(char **p);
int selectUserPrivilege(const char *name, char *body);
#if 0
bool add_privi(char *role,char *privi);
bool del_privi(char *role,char *privi);
bool select_privi(char *role,char *privi);
int select_user_store(char* sql,char ***user_info);
#endif
int mysql_real_query1(char *sql);
private:
MYSQL_RES *result;
MYSQL *conn;
MYSQL_ROW row;
};
#endif