| | |
| | | #ifndef _DBUNTIL_H_
|
| | | #define _DBUNTIL_H_
|
| | |
|
| | | struct person {
|
| | | #include <mysql.h>
|
| | | struct person
|
| | | {
|
| | | int p_id;
|
| | | char *name;
|
| | | int f_id;
|
| | | //ͼƬ
|
| | | };
|
| | |
|
| | | struct my_db {
|
| | | struct my_db
|
| | | {
|
| | | char user[25];
|
| | | char pswd[25];
|
| | | char host[25];
|
| | |
| | |
|
| | | public:
|
| | | DBuntil();
|
| | | DBuntil(my_db mydb);
|
| | | ~DBuntil();
|
| | | person db_rearch(int f_id);
|
| | |
|
| | | bool db_register(int f_id,person *p);
|
| | |
|
| | | bool db_search(person *p);
|
| | | bool db_register(person *p);
|
| | | bool db_init(my_db mydb);
|
| | | |
| | | MYSQL myCont;
|
| | | MYSQL_RES *result;
|
| | | MYSQL_ROW sql_row;
|
| | | private:
|
| | |
|
| | | bool db_add(int f_id,person *per);
|
| | | bool db_add(person *per);
|
| | | int db_update();
|
| | | bool db_select(int f_id,person *per);
|
| | |
|
| | | bool db_select(person *per);
|
| | | char sql[1024];
|
| | | int res;
|
| | | };
|
| | |
|
| | | };
|
| | |
|
| | | #endif |