mysql_fetch_field_row crash server
#1

This script crash the server. The concern is "mysql_fetch_field_row" Here is an excerpt of the script and the emulator:

Код:
public OnPlayerConnect(playerid)
{
    for(new x; x < _: pInfo; ++x ) PlayerInfo[playerid][pInfo: x] = 0;

    new query[256],
        string[256],
        field[30],
		name[24];

	GetPlayerName(playerid, name, sizeof(name));

    format(query, sizeof(query), "SELECT `id`, `admin`, `skin` FROM `accounts` WHERE `username` = '%s'", name);
	mysql_query(query);
	mysql_store_result();
 	if(mysql_retrieve_row())
	{
 		mysql_fetch_field_row(field, "id"); PlayerInfo[playerid][pID] = strval(field);
	    mysql_fetch_field_row(field, "admin"); PlayerInfo[playerid][pAdmin] = strval(field);
	    mysql_fetch_field_row(field, "skin"); PlayerInfo[playerid][pSkin] = strval(field);

	    format(string, sizeof(string), "Vous кtes connectй sous votre compte %s.", name);
	    SendClientMessage(playerid, -1, string);
	    return 1;
	} else SendClientMessage(playerid, -1, "Aucun compte enregistrй а ce nom.");
 	mysql_free_result();
	return 1;
}
Код:
SA-MP Dedicated Server
----------------------
v0.3.7-R2, ©2005-2015 SA-MP Team

[11:26:46] filterscripts = ""  (string)
[11:26:46] 
[11:26:46] Server Plugins
[11:26:46] --------------
[11:26:46]  Loading plugin: crashdetect
[11:26:46]   CrashDetect v4.13 is OK.
[11:26:46]   Loaded.
[11:26:46]  Loading plugin: mysql
[11:26:46] 

  > MySQL plugin R5 successfully loaded.

[11:26:46]   Loaded.
[11:26:46]  Loaded 2 plugins.

[11:26:46] 
[11:26:46] Filterscripts
[11:26:46] ---------------
[11:26:46]   Loaded 0 filterscripts.

[11:26:46] Connexion а la base de donnйe rйussite.
[11:26:46] Total des comptes chargйs: 1.
[11:26:46] Number of vehicle models: 0
[11:27:03] [connection] 25.91.13.119:52880 requests connection cookie.
[11:27:04] [connection] incoming connection: 25.91.13.119:52880 id: 0
[11:27:04] [join] Karlos has joined the server (0:25.91.13.119)
[11:27:04] [debug] Server crashed while executing servermysql.amx
[11:27:04] [debug] AMX backtrace:
[11:27:04] [debug] #0 native mysql_fetch_field_row () [100065e0] from mysql.DLL
[11:27:04] [debug] #1 000008dc in public OnPlayerConnect (0x00000000) from servermysql.amx
[11:27:05] [debug] Native backtrace:
[11:27:05] [debug] #0 632cb9f0 in ?? () from C:\WINDOWS\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.8387_none_5094ca96bcb6b2bb\MSVCR90.dll
[11:27:05] [debug] #1 100090b4 in ?? () from plugins\mysql.DLL
[11:27:05] [debug] #2 100066b3 in ?? () from plugins\mysql.DLL
[11:27:05] [debug] #3 004010b6 in ?? () from samp-server.exe
[11:27:05] [debug] #4 5fac58ca in ?? () from plugins\crashdetect.DLL
[11:27:05] [debug] #5 5fac774f in ?? () from plugins\crashdetect.DLL
[11:27:05] [debug] #6 5fac0834 in ?? () from plugins\crashdetect.DLL
[11:27:05] [debug] #7 5fac591a in ?? () from plugins\crashdetect.DLL
[11:27:05] [debug] #8 0046d960 in ?? () from samp-server.exe
[11:27:05] [debug] #9 0046650f in ?? () from samp-server.exe
[11:27:05] [debug] #10 00498d56 in ?? () from samp-server.exe
[11:27:05] [debug] #11 00469939 in ?? () from samp-server.exe
[11:27:05] [debug] #12 00498e11 in ?? () from samp-server.exe
[11:27:05] [debug] #13 004950d4 in ?? () from samp-server.exe
[11:27:05] [debug] #14 458d5151 in ?? () from samp-server.exe
[11:27:05] [debug] #15 15ff50f8 in ?? () from samp-server.exe
[11:27:05] [debug] #16 004ac0c4 in ?? () from samp-server.exe
Thanks!
Reply


Messages In This Thread
mysql_fetch_field_row crash server - by Rubey - 14.07.2016, 09:28
Re: mysql_fetch_field_row crash server - by Rubey - 15.07.2016, 09:39
Re: mysql_fetch_field_row crash server - by gurmani11 - 15.07.2016, 10:40
Re: mysql_fetch_field_row crash server - by Rubey - 09.08.2016, 15:46
Re: mysql_fetch_field_row crash server - by Shinja - 09.08.2016, 18:44
Re: mysql_fetch_field_row crash server - by Rubey - 12.08.2016, 10:40

Forum Jump:


Users browsing this thread: 5 Guest(s)