MySQL Based on Linux by C

zhaozj2021-02-11  214

INT loginjudge (user_account req) {

INT i = 0; char * reqname; char * password; char * reqpass; reqName = Req.name; Reqpass = Req.password;

IF (! (! "," 1111 "))) Return False; if (MySQL_SELECT_DB (& Mysql," ServerDB ")) Return False; if (MySQL_Query (& mysql," SELECT NAME, Password from main ")) Return False; if (! (R = mysql_store_result (& mysql))) Return False; while ((Row = mysql_fetch_row (res))) {name = row [0]; password = row [1]; if (! strcmp (name, reqname)) {if) return TRUE (strcmp (password, reqpass!); else return FALSE;}} if) return FALSE (mysql_eof (res!); mysql_free_result (res); mysql_close (& mysql); return FALSE }

INT Authority (Char * Name) {Long ing ibackvalue; char * cdbauthority; char * CQUENAME; char * CVALUEONE; char * cvaluetwo;

CQUENAME = Name; CVALUEONE = "1"; CVALUETWO = "2"; if (! ("(! (mSQL_Connect (& mysql, null," root "," 1111 ")) RETURN FALSE; if (MySQL_SELECT_DB (& mysql," serverDB "))) return FALSE; if (mysql_query (& mysql, "select name, authority from main")) return FALSE; if (! (res = mysql_store_result (& mysql))) return FALSE; while ((row = mysql_fetch_row (res))) {cDBname = row [0]; cdbauthority = row [1]; if (! strcmp (cdbname, cquename)) {if (! strcmp (cvalueone, cdbauthor)) {ibackvalue = 1; if (! strcmp (cvaluetwo, cdbauthority) ibackValue = 2;} else ingvalue = 3;}}

IF (! mysql_eof (res)) Return False; mysql_free_result (res); mysql_close (& mysql); return ibackvalue;}

转载请注明原文地址:https://www.9cbs.com/read-5951.html

New Post(0)