MySQL Cache Need Help
#1

I don't really know what i'm doing wrong, is first time when i used MySQL Cached and i don't understand somethings :d

This is error in server log:
Код:
[20:44:58] [debug] Server crashed while executing gf2.amx
[20:44:58] [debug] AMX backtrace:
[20:44:58] [debug] #0 native CallLocalFunction () [00471e90] from samp-server.exe
[20:44:58] [debug] #1 00015788 in ?? () from gf2.amx
[20:44:58] [debug] #2 000056e8 in ?? () from gf2.amx
[20:44:58] [debug] #3 00002a5c in ?? () from gf2.amx
[20:44:58] [debug] #4 000024e4 in ?? () from gf2.amx
[20:44:58] [debug] #5 00001d38 in ?? () from gf2.amx
[20:44:58] [debug] #6 00001a08 in public OnGameModeInit () from gf2.amx
[20:44:58] [debug] System backtrace:
[20:44:58] [debug] #0 004010b6 in ?? () from C:\Users\shaPP\Desktop\samp03x_svr_R1-2_win32\samp-server.exe
[20:44:58] [debug] #1 6992340a in ?? () from C:\Users\shaPP\Desktop\samp03x_svr_R1-2_win32\plugins\crashdetect.DLL
[20:44:58] [debug] #2 69925aa6 in ?? () from C:\Users\shaPP\Desktop\samp03x_svr_R1-2_win32\plugins\crashdetect.DLL
[20:44:58] [debug] #3 6991d621 in ?? () from C:\Users\shaPP\Desktop\samp03x_svr_R1-2_win32\plugins\crashdetect.DLL
[20:44:58] [debug] #4 6992345a in ?? () from C:\Users\shaPP\Desktop\samp03x_svr_R1-2_win32\plugins\crashdetect.DLL
[20:44:58] [debug] #5 0046e194 in ?? () from C:\Users\shaPP\Desktop\samp03x_svr_R1-2_win32\samp-server.exe
[20:44:58] [debug] #6 65646f6d in ?? () from C:\Users\shaPP\Desktop\samp03x_svr_R1-2_win32\samp-server.exe
[20:44:58] [debug] #7 66672f73 in ?? () from C:\Windows\system32\MSVCR110.dll
[20:44:58] [debug] #8 6d612e32 in ?? () from C:\Users\shaPP\Desktop\samp03x_svr_R1-2_win32\samp-server.exe
Error in mysql log:
Код:
[20:44:49] ProcessQueryThread(OnPropertyLoad) - Executing query SELECT * FROM `sp_houses` ORDER BY id ASC...
[20:44:49] ProcessQueryThread(OnPropertyLoad) - Query was successful.
[20:44:49] ProcessQueryThread(OnPropertyLoad) - Data caching enabled.
[20:44:49] CMySQLHandler::StoreResult() - Result was stored.
[20:44:49] CMySQLHandler::FreeResult() - Result was successfully freed.
[20:44:49] ProcessQueryThread(OnPropertyLoad) - Data being passed to ProcessTick().
[20:44:58] >> mysql_close(Connection handle: 1)
[20:44:58] CMySQLHandler::~CMySQLHandler() - deconstructor called.
[20:44:58] CMySQLHandler::FreeResult() - The result is already empty.
[20:44:58] CMySQLHandler::Disconnect() - Connection was closed.
[20:44:58] >> mysql_query_callback(Connection handle: 1)
[20:44:58] >> mysql_query_callback() - Invalid connection handle. (ID = 1).
[20:44:58] >> mysql_query_callback(Connection handle: 1)
[20:44:58] >> mysql_query_callback() - Invalid connection handle. (ID = 1).
And this is my code:
Код:
public LoadProperty()
{
	mysql_function_query(g_Handle, "SELECT * FROM `sp_houses` ORDER BY id ASC", true, "OnPropertyLoad", "", "");
	return 1;
}

forward OnPropertyLoad();
public OnPropertyLoad()
{
	new rows, fields;
	cache_get_data(rows, fields); 
	if(rows) {
		for(new i = 0; i != fields; i++)
		{
			new 
				temp[128];
			cache_get_row(i, 1, temp); HouseInfo[i][hEntrancex] = floatstr(temp);
			cache_get_row(i, 2, temp); HouseInfo[i][hEntrancey] = floatstr(temp);
			cache_get_row(i, 3, temp); HouseInfo[i][hEntrancez] = floatstr(temp);
			cache_get_row(i, 4, temp); HouseInfo[i][hExitx] = floatstr(temp);
			cache_get_row(i, 5, temp); HouseInfo[i][hExity] = floatstr(temp);
			cache_get_row(i, 6, temp); HouseInfo[i][hExitz] = floatstr(temp);
			cache_get_row(i, 7, temp); HouseInfo[i][hOwner] = temp;
			cache_get_row(i, 8, temp); HouseInfo[i][hDiscription] = temp;
			cache_get_row(i, 9, temp); HouseInfo[i][hValue] = strval(temp);
			cache_get_row(i, 10, temp); HouseInfo[i][hHel] = strval(temp);
			cache_get_row(i, 11, temp); HouseInfo[i][hArm] = strval(temp);
			cache_get_row(i, 12, temp); HouseInfo[i][hInt] = strval(temp);
			cache_get_row(i, 13, temp); HouseInfo[i][hLock] = strval(temp);
			cache_get_row(i, 14, temp); HouseInfo[i][hOwned] = strval(temp);
			cache_get_row(i, 15, temp); HouseInfo[i][hRent] = strval(temp);
			cache_get_row(i, 16, temp); HouseInfo[i][hRentabil] = strval(temp);
			cache_get_row(i, 17, temp); HouseInfo[i][hTakings] = strval(temp);
			cache_get_row(i, 18, temp); HouseInfo[i][hVec] = strval(temp);
			cache_get_row(i, 19, temp); HouseInfo[i][hVcol1] = strval(temp);
			cache_get_row(i, 20, temp); HouseInfo[i][hVcol2] = strval(temp);
			cache_get_row(i, 21, temp); HouseInfo[i][hLevel] = strval(temp);
			cache_get_row(i, 22, temp); HouseInfo[i][hMats] = strval(temp);
			cache_get_row(i, 23, temp); HouseInfo[i][hDrugs] = strval(temp);
			HouseInfo[i][hWorld] = i;
			printf("HouseInfo: %d | Owner: %s | hTakings: %d | hVec = %d |",i,HouseInfo[i][hOwner],HouseInfo[i][hTakings],HouseInfo[i][hVec]);
		}
	}
	return 1;
}
Reply
#2

Anyone can help me ?
Reply
#3

Код:
>> mysql_close(Connection handle: 1)
[20:44:58] CMySQLHandler::~CMySQLHandler() - deconstructor called.
[20:44:58] CMySQLHandler::FreeResult() - The result is already empty.
[20:44:58] CMySQLHandler::Disconnect() - Connection was closed.
as i can understand from here the connection to mysql is closed , check where you close the connection , only close it at the end of
Код:
public OnGamemodeExit()
Reply
#4

I posted the place where mysql connection is closed. But i don't understand what i'm doing wrong.
Reply
#5

bump
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)