Quote:
Originally Posted by yanir3
Hey, I recently started working with mySQL, I have a problem with my login system.
It's just not loading the stats.
pawn Код:
forward LoadUser(playerid); public LoadUser(playerid) { new query[256]; format(query, sizeof(query),"SELECT * FROM playerinfo WHERE Name=%s",pName(playerid)); mysql_query(query); mysql_store_result(); if(mysql_num_rows()) if(mysql_fetch_row_format(query,"|")) { new field[13][MAX_PLAYER_NAME]; explode(query, field, "|"); mysql_free_result(); // This line must be under all other things you want to set PlayerInfo[playerid][Money] = strval(field[3]); PlayerInfo[playerid][Admin] = strval(field[4]); PlayerInfo[playerid][Level] = strval(field[5]); PlayerInfo[playerid][Bank] = strval(field[6]); PlayerInfo[playerid][Kills] = strval(field[7]); PlayerInfo[playerid][Deaths] = strval(field[8]); PlayerInfo[playerid][Skin] = strval(field[9]); PlayerInfo[playerid][Job] = strval(field[10]); PlayerInfo[playerid][Watch] = strval(field[11]); PlayerInfo[playerid][Notepad] = strval(field[12]); } }
I can't find the problem.. can someone help me please?
|
As you see above in the comment you free the result before you set anything put it under your last thing you want to get