SA-MP Forums Archive
MYSQL cache - 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 cache (/showthread.php?tid=553929)



MYSQL cache - n00el - 01.01.2015

I have this return and error code, wat's wrong?

Код:
ReturnOfflineName(id)
{
	new query[128], name[MAX_PLAYER_NAME + 1];

    format(query, sizeof(query), "SELECT `Character` FROM `characters` WHERE `ID` = '%d'", id);
	mysql_function_query(g_iHandle, query, false, "", "");
	
	static
	    rows,
	    fields;
	    
	//cache_get_data(rows, fields, g_iHandle);

	cache_get_field_content(0, "Character", name);

	return name;
}
Код:
[14:26:09] >> mysql_query_callback( Connection handle: 1 )
[14:26:09] >> cache_get_data( Connection handle: 1 )
[14:26:09] CMySQLHandler::ProcessQueryThread() - Reconnection attempt in background thread.
[14:26:09] CMySQLHandler::Connect() - Connection was successful.
[14:26:09] CMySQLHandler::Connect() - Auto-Reconnect has been enabled.
[14:26:09] Passing query SELECT `Character` FROM `characters` WHERE `ID` = '1' | 
[14:26:09] ProcessQueryThread() - Query was successful. (SELECT `Character` FROM `characters` WHERE `ID` = '1')
[14:26:09] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()



Re: MYSQL cache - Vince - 01.01.2015

You need a callback. Structures like these aren't possible in the new plugins.


Re: MYSQL cache - n00el - 01.01.2015

And how it's possible?