| | |
| | | mysql_close(&myCont);
|
| | | }
|
| | |
|
| | | person DBuntil::db_rearch(int f_id)
|
| | | *person DBuntil::db_rearch(int f_id)
|
| | | {
|
| | | person p= {0,""};
|
| | | db_select(f_id,&p);
|
| | | //对结构体赋值
|
| | | return p;
|
| | | return &p;
|
| | | }
|
| | |
|
| | | int DBuntil::db_select(int f_id,person* per)
|
| | | bool DBuntil::db_select(int f_id,person* per)
|
| | | {
|
| | |
|
| | | sprintf( sql, "select a.p_id,b.`name`,b.img from face_person a,user_info b where a.face_id = %d AND a.p_id = b.pid " , f_id );
|
| | |
| | | return true;
|
| | | }
|
| | |
|
| | | int DBuntil::db_add(int f_id,person *per)
|
| | | bool DBuntil::db_add(int f_id,person *per)
|
| | | {
|
| | | //
|
| | | sprintf( sql, "INSERT INTO user_info(NAME, img) VALUES('%s', NULL)" , per->name );
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | int DBuntil::db_register(int f_id,person *per)
|
| | | bool DBuntil::db_register(int f_id,person *per)
|
| | | {
|
| | | if(db_add(f_id,per)){
|
| | | return true;
|