sscanf resultline issue. (MySQL)
#1

Before switching from Windows to Linux the following code used to work, however.. After switching plugins it does not.

Yes, I have made sure I have the correct one and yes I have made sure that the SQL Query works.

pawn Код:
format(saltquery, sizeof(saltquery), "SELECT `psalt` FROM `playerinfo` WHERE `username` = '%s'", pName(playerid));
                mysql_query(saltquery);
                mysql_store_result();
               
                print(saltquery);
                new resultline[200];
                if(mysql_fetch_row_format(resultline))
                {
                    //you can now use sscanf, explode, split or strtok to split result
                    sscanf(resultline,"p<|>s[38]",PVar[playerid][psalt]); // dis is broken
                }
The issue is that "PVar[playerid][psalt]" isn't actually assigned the SALT from the database. Any help would be appreciated..
Reply
#2

Why not just fetch the result into your designated variable directly?
pawn Код:
mysql_store_result();
mysql_fetch_row_format(PVar[playerid][psalt]);
Delete the rest.
Reply
#3

I have done that, but it is still returning "(null)"
Reply
#4

Still having issues with this, there is no returning value..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)