Help with cache_get_data
#1

hey guys i have one problem with cache_get_data my code here:

Код:
public CheckAccout(playerid){
	new pName[MAX_PLAYER_NAME],str[180],query[128];
	GetPlayerName(playerid,pName,sizeof(pName));
	mysql_format(connect,query,sizeof(query),"SELECT * FROM `users` WHERE `username` = '%e'",pName);
	mysql_tquery(connect,query,"","");
	if(cache_num_rows()){
		format(str,sizeof(str),"{FFFFFF}Welcome\nPlease type one password for register an accout!\n");
		ShowPlayerDialog(playerid,DIALOG_LOG,DIALOG_STYLE_INPUT,"{00FF00}Login",str,"Login","Quit");
	}else{
	    format(str,sizeof(str),"{FFFFFF}Welcome\nPlease type your password!\n");
	    ShowPlayerDialog(playerid,DIALOG_REG,DIALOG_STYLE_INPUT,"{00FF00}Register",str,"Register","Quit");
	}
	return 1;
}
and get me [WARNING] cache_get_data - no active cache
who is problem?
thanks!

edit:LOL i fixed but now i have this problem

[WARNING] cache_get_row_count - no active cache

with code look up :P
Reply
#2

This is because you're using a threaded query (mysql_tquery) which generally calls a callback once it is done. You have not specified any callback and there won't be any cached results yet because it gets sent straight to a thread to be executed. You either need to run you next lot of code in a callback or use a non threaded query.
Reply
#3

Quote:
Originally Posted by !damo!spiderman
Посмотреть сообщение
This is because you're using a threaded query (mysql_tquery) which generally calls a callback once it is done. You have not specified any callback and there won't be any cached results yet because it gets sent straight to a thread to be executed. You either need to run you next lot of code in a callback or use a non threaded query.
ohh yes! thanks you i use new Cache:r and mysql_query and cache_delete and fixed thanks you very much
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)