25.01.2010, 21:53
hey... someone give me this code for get data from a mysql database
Wheell this saids "Your pass is:" but no saids the PASS .. example "Your pass is: 515gf6h5fh" like that :/ ...
so i dont understand the code and this part is rare... here
i dont understand "sscanf(line, "p.sdd"," what is the "p.sdd"
Any one can help me? plss
Код:
LoadData(playerid) { new pName[24], query[61], line[100]; GetPlayerName(playerid, pName, 24); mysql_real_escape_string(pName, pName); format(query, sizeof(query), "SELECT * FROM jugadores WHERE nombre='%s'", pName); // we check and get the gata from that name mysql_query(query); mysql_store_result(); // we store the result. mysql_fetch_row_format(line, "."); // we set a delimiter sscanf(line, ".", pinfo[playerid][id], pinfo[playerid][nombre], pinfo[playerid][pass], pinfo[playerid][dinero], pinfo[playerid][trabajo], pinfo[playerid][admin]); // this will get the first 3 fields into pinfo[playerid][playeri] mysql_free_result(); new textto[128]; format(textto, sizeof(textto), "Your pass is: %s", pinfo[playerid][pass]); SendClientMessage(playerid, COLOR_LIGHTBLUE, textto); return 1; }
so i dont understand the code and this part is rare... here
Код:
sscanf(line, "p.sdd", pinfo[playerid][id], pinfo[playerid][nombre], pinfo[playerid][pass], pinfo[playerid][dinero], pinfo[playerid][trabajo], pinfo[playerid][admin]); // this will get the first 3 fields into pinfo[playerid][playeri]
Any one can help me? plss