forked from onlyou2030/Student-Information-Manage-System
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmysql.h
29 lines (24 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
#ifndef MYSQL_H
#define MYSQL_H
#include <QSql>
#include <QSqlDatabase>
#include <QDebug>
#include <QSqlQuery>
#include "mainwindow.h"
#include "addinfo.h"
class MySql
{
public:
MySql();
void initsql(); //初始化连接数据库
void createtable(); //建表 索引 触发器
bool inituser(QString name,QString identify,QString passward); //将注册信息添加数据库
bool loguser(QString name,QString passward); //验证登录信息
bool forgetpassward(QString name,QString identify); //根据姓名和身份信息找回密码
bool addstu(my_stu* stu); //添加学生信息
bool updatestu(my_stu* stu); //修改学生信息
bool deletestu(QString account); //删除学生信息
private:
QSqlQuery *query;
};
#endif // MYSQL_H