代码拉取完成,页面将自动刷新
/**
* title: mysql.hpp
* author: sleeeeeping
* created: 2024-09-12 19:21:35
**/
#ifndef _MYSQL_HPP__
#define _MYSQL_HPP__
#include <vector>
#include <iostream>
#include <mysql/mysql.h>
using u32 = unsigned int;
class MySQL {
private:
MYSQL *mysql;
std::vector<std::vector<std::string>> result;
public:
MySQL(void);
~MySQL(void);
bool connect(const std::string &host,
const std::string &user, const std::string &passwd,
const std::string &db, u32 port = 3306
);
int query(const std::string &sql);
const std::vector<std::vector<std::string>> &getQueryRestult(void);
bool getAutoCommit(void);
bool setAutoCommit(bool isAutoCommit);
bool commit(void);
bool rollback(void);
bool setCharacterSet(const std::string &csname);
const char* getCharacterSet(void);
void showError(void);
};
#endif // _MYSQL_HPP__
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。