Mysql stats wont load. - 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: Mysql stats wont load. (
/showthread.php?tid=381400)
Mysql stats wont load. -
thefatshizms - 29.09.2012
pawn Code:
stock LoadStats(playerid)
{
new pName[24],Query[200];
GetPlayerName(playerid,pName,24);
format(Query, sizeof(Query), "SELECT * FROM `users` WHERE `username` = '%s' ", pName);
mysql_query(Query);
mysql_store_result();
new rstr[100];
while(mysql_fetch_row_format(Query, "|"))
{
mysql_fetch_field_row(rstr, "money");
PlayerInfo[playerid][Pmoney] = strval(rstr);
mysql_fetch_field_row(rstr, "admin");
PlayerInfo[playerid][Padmin] = strval(rstr);
}
mysql_free_result();
GivePlayerMoney(playerid,PlayerInfo[playerid][Pmoney]);
return 1;
}
The stats are not loading
Re: Mysql stats wont load. -
doreto - 29.09.2012
any errors from debug log ?
Re: Mysql stats wont load. -
thefatshizms - 29.09.2012
Nope
Code:
:59:10] CMySQLHandler::Query(SELECT `Username` FROM `users` WHERE `username` = 'thefatshizms' LIMIT 1;) - Successfully executed.
[13:59:10] >> mysql_store_result( Connection handle: 1 )
[13:59:10] CMySQLHandler::StoreResult() - Result was stored.
[13:59:10] >> mysql_num_rows( Connection handle: 1 )
[13:59:10] CMySQLHandler::NumRows() - Returned 1 row(s)
[13:59:10] >> mysql_free_result( Connection handle: 1 )
[13:59:10] CMySQLHandler::FreeResult() - Result was successfully free'd.
[13:59:17] >> mysql_real_escape_string( Connection handle: 1 )
[13:59:17] CMySQLHandler::EscapeString(28629902170188); - Escaped 11 characters to 28629902170188.
[13:59:17] >> mysql_real_escape_string( Connection handle: 1 )
[13:59:17] CMySQLHandler::EscapeString(thefatshizms); - Escaped 12 characters to thefatshizms.
[13:59:17] >> mysql_query( Connection handle: 1 )
[13:59:17] CMySQLHandler::Query(SELECT * FROM `users` WHERE `username` = 'thefatshizms' AND `password` = 'chelsea9723') - Successfully executed.
[13:59:17] >> mysql_store_result( Connection handle: 1 )
[13:59:17] CMySQLHandler::StoreResult() - Result was stored.
[13:59:17] >> mysql_num_rows( Connection handle: 1 )
[13:59:17] CMySQLHandler::NumRows() - Returned 1 row(s)
[13:59:17] >> mysql_query( Connection handle: 1 )
[13:59:17] CMySQLHandler::Query(SELECT * FROM `users` WHERE `username` = 'thefatshizms' ) - Successfully executed.
[13:59:17] >> mysql_store_result( Connection handle: 1 )
[13:59:17] CMySQLHandler::StoreResult() - Result was stored.
[13:59:17] >> mysql_fetch_row_format( Connection handle: 1 )
[13:59:17] CMySQLHandler::FetchRow() - Return: thefatshizms|28629902170188|0|16455|0|0|0|0|5|0|28/08/2012|0|0|0|0|0|0|0|0|0|0|0|0|0|0
[13:59:17] >> mysql_fetch_field_row( Connection handle: 1 )
[13:59:17] CMySQLHandler::FetchField("Money") -
[13:59:17] >> mysql_fetch_field_row( Connection handle: 1 )
[13:59:17] CMySQLHandler::FetchField("Admin") -
[13:59:17] >> mysql_fetch_row_format( Connection handle: 1 )
[13:59:17] >> mysql_free_result( Connection handle: 1 )
[13:59:17] CMySQLHandler::FreeResult() - Result was successfully free'd.
[13:59:17] >> mysql_free_result( Connection handle: 1 )
[13:59:17] CMySQLHandler::FreeResult() - The result is already empty.