Sscanf query failing with skin.
#1

Hi, I am having trouble with fetching the skin for a player, it should be retrieving the skin from "skin" but instead, it retrieves it from "score" which is quite odd.

pawn Код:
new query[500];
    format(query, sizeof(query),"SELECT * FROM `playerdb` WHERE `username` = '%s'",playerdb[playerid][username]);
    mysql_query(query);
    mysql_store_result();
    while(mysql_fetch_row(query,"|"))
    {
        sscanf(query, "p<|>e<s[25]s[35]iiiii>", playerdb[playerid]);
        SetPlayerSkin(playerid, playerdb[playerid][skin]);
    }
    mysql_free_result();
    return 1;
}
also, my enums are
Код:
username[MAX_PLAYER_NAME],
password[32],
score,
money,
power,
deaths,
skin,
Thanks for the help!
Reply
#2

Check the order of your fields in the MySQL database. Something could be muddled up.
Reply
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
MAX_PLAYER_NAME is 24 not 25, and 32 is 32, not 35.
The reason I had those was to get rid of the string buffer overload, but apparently, that clogged up more bits.
Now i'm only left with the "string buffer overload" warning each time that gets called. But thanks!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)