Problem with loading SQL
#1

So saving my SQL works perfectly fine. But when I load it in it adds the number 48 to each var (except the password, username and money vars). For the money, it makes it some random number, most noticeably 57. I don't understand what I did wrong. They're all integers.

Code:
stock LoginPlayer( playerid )
{
	new query[128], pName[MAX_PLAYER_NAME];
	GetPlayerName( playerid, pName, sizeof( pName ) );
	
	format( query, sizeof( query ), "SELECT * FROM accounts WHERE Name = '%s'", pName );
	mysql_query( query );
	mysql_store_result();
	
	while( mysql_fetch_row_format( query, "|" ) ) {
	    mysql_fetch_field_row( Player[playerid][Name], "Name" );
	    mysql_fetch_field_row( Player[playerid][Password], "Password" );
	    mysql_fetch_field_row( Player[playerid][Kills], "Kills" );
	    mysql_fetch_field_row( Player[playerid][Deaths], "Deaths" );
	    mysql_fetch_field_row( Player[playerid][AdminLvl], "AdminLvl" );
	    mysql_fetch_field_row( Player[playerid][Money], "Money" );
	}
	
	GivePlayerMoney( playerid, Player[playerid][Money] );
}
Reply
#2

Bump
Reply
#3

Bump
Reply
#4

Show your table structure and enum used by Player.
Reply
#5

Quote:
Originally Posted by Misiur
View Post
Show your table structure and enum used by Player.
Code:
enum PlayerStats {
	Name[128],
	Password[128],
	Kills,
	Deaths,
	AdminLvl,
	Money,
}
new Player[MAX_PLAYERS][PlayerStats];
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)