Mysql stats wont load.
#1

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
Reply
#2

any errors from debug log ?
Reply
#3

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)