sscanf resultline issue. (MySQL) - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: sscanf resultline issue. (MySQL) (
/showthread.php?tid=403701)
sscanf resultline issue. (MySQL) -
vIBIENNYx - 31.12.2012
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..
Re: sscanf resultline issue. (MySQL) -
Vince - 31.12.2012
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.
Re: sscanf resultline issue. (MySQL) -
vIBIENNYx - 31.12.2012
I have done that, but it is still returning "(null)"
Re: sscanf resultline issue. (MySQL) -
vIBIENNYx - 02.01.2013
Still having issues with this, there is no returning value..