Loading MySQL data in Enum
#1

Hey guys,

Im not sure how im able to transfer data that are 'stored' in MySQL, to an enum.

Would it work like this, or wouldnt this work at all (or is there a better way?)?
pawn Код:
while( mysql_fetch_row_format( query, "|" ) )
{
    mysql_fetch_field_row( savingstring, "Naam" );
    PlayerInfo[playerid][Naam] = savingstring;
    mysql_fetch_field_row( savingstring, "Score" );
    PlayerInfo[playerid][Score] = savingstring;
}
~Wesly
Reply
#2

I tend to use sscanf, example:
pawn Код:
while(mysql_fetch_row_format(line))
    {
        sscanf(line, "p<|>dddd", 1, 2, 3, 4);
    }
No idea if it'll be faster or not.
Reply
#3

And where the 1, 2, 3, 4 are, should there the items be which you wanna load into a variable? Example, 1 will be the name, 2 will be the password, 3 will be the score, 4 the money, or..?
Reply
#4

Yeah.
Reply
#5

Alright, thanks! I will try that out
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)