-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDB.h
More file actions
43 lines (28 loc) · 591 Bytes
/
DB.h
File metadata and controls
43 lines (28 loc) · 591 Bytes
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
//
// Created by cmg on 5/30/20.
//
#include <string>
#include <iostream>
#include <mysql/mysql.h>
#include "/usr/include/mysql/mysql.h"
using namespace std;
#ifndef SIMS_DB_H
#define SIMS_DB_H
class DB {
private:
MYSQL *mysql;
MYSQL_RES *result{};
MYSQL_ROW row{};
const char *host = "localhost";
const char *user = "root";
const char *password = "123456";
const char *db = "aaa";
public:
DB();
~DB();
bool connectDb();
bool execSql(string sql);
bool execSql(string sql, string &res);
bool closeDb();
};
#endif //SIMS_DB_H