Posts: 112
Threads: 8
Joined: Jan 2013
Quote:
Originally Posted by ElectricBox
login mysql
pawn Код:
stock MySql_Login(playerid) { new pname[24], savingstring[20]; new MySql_QueryLogin[500]; GetPlayerName(playerid, pname, 24); format(MySql_QueryLogin, sizeof(MySql_QueryLogin), "SELECT * FROM `playerdata` WHERE `name` = '%s'", PlayerName(playerid)); mysql_query(MySql_QueryLogin); mysql_store_result(); while(mysql_fetch_row_format(MySql_QueryLogin,"|")) { mysql_fetch_field_row(savingstring,"score"); SetPlayerScore(playerid,strval(savingstring)); mysql_fetch_field_row(savingstring,"money"); GivePlayerMoney(playerid,strval(savingstring));
SystemMsg(playerid,"You are now logged in. Your stats will be auto-saved when you disconnect"); PLAYERLIST_authed[playerid]=true; } mysql_free_result(); return 1; }
last part of debug problem area
pawn Код:
[19:23:42] CMySQLHandler::Query(SELECT * FROM `playerdata` WHERE `name`='VoxPF' AND `password`='reallly') - Successfully executed. [19:23:42] >> mysql_store_result( Connection handle: 1 ) [19:23:42] CMySQLHandler::StoreResult() - Result was stored. [19:23:42] >> mysql_num_rows( Connection handle: 1 ) [19:23:42] CMySQLHandler::NumRows() - Returned 1 row(s) [19:23:42] >> mysql_query( Connection handle: 1 ) [19:23:42] CMySQLHandler::Query(SELECT * FROM `playerdata` WHERE `name` = 'VoxPF') - Successfully executed. [19:23:42] >> mysql_store_result( Connection handle: 1 ) [19:23:42] CMySQLHandler::StoreResult() - Result was stored. [19:23:42] >> mysql_fetch_row_format( Connection handle: 1 ) [19:23:42] CMySQLHandler::FetchRow() - Return: VoxPF|amir11211|77126|0|7500|10000|0|0|0|0|0|0|0|0|0|0|0|0|0|6|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0 [19:23:42] >> mysql_fetch_field_row( Connection handle: 1 )
|
I don`t see an error in this code but why do you use mysql_fetch_row_format and then
mysql_fetch_field_row. You can use mysql_fetch_row_format to get the whole row and split that with sscanf.
Do you know that you get also the date with mysql_fetch_field_row.
But you can try something to download the crashdetect plugin and then compile your script with the debugmode
from pawno