SA-MP Forums Archive
why mysql callback doesnt process? - 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: why mysql callback doesnt process? (/showthread.php?tid=409812)



why mysql callback doesnt process? - yxliang - 23.01.2013

I use mysql plugin r7
Код:
mysql_function_query(mysql_Account, query, false, "IsResultExist","i",i);



Re: why mysql callback doesnt process? - yxliang - 23.01.2013

any one knows that?


Re: why mysql callback doesnt process? - jonrb - 23.01.2013

Check what this outputs:

Код:
public OnQueryError(errorid, error[], resultid, extraid, callback[], query[], connectionHandle)
{
printf("(%i) %s",errorid, error);
}



Re: why mysql callback doesnt process? - yxliang - 23.01.2013

Quote:
Originally Posted by jonrb
Посмотреть сообщение
Check what this outputs:

Код:
public OnQueryError(errorid, error[], resultid, extraid, callback[], query[], connectionHandle)
{
printf("(%i) %s",errorid, error);
}
that's not error exist. In mysql_log.txt that is wrote about query success. So IsResultExist should be runned.

[18:00:18] Passing query SELECT `Id` FROM `Account` WHERE `Name`='Mxtdg_Goodx' limit 1 | i
[18:00:18] ProcessQueryThread(IsResultExist) - Query was successful. (SELECT `Id` FROM `Account` WHERE `Name`='Mxtdg_Goodx' limit 1)
[18:00:18] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()


Re: why mysql callback doesnt process? - yxliang - 23.01.2013

Need help..


Re: why mysql callback doesnt process? - yxliang - 23.01.2013

Quote:
Originally Posted by ******
Посмотреть сообщение
Can you show your "IsResultExist" function?
Can you reply the pm message?
Код:
forward IsResultExist(handleid);
public IsResultExist(handleid)
{
    SendClientMessageToAll(COLOR_RED,"IsResultExist Runned");
    mysql_store_result_Account();
    if(!mysql_num_rows_Account())
    {
	mysql_Result_Check[handleid] = 0;
    }
	else
	{
	mysql_Result_Check[handleid] = 1;
	}
	mysql_free_result_Account();
return 1;
}



Re: why mysql callback doesnt process? - B-Matt - 23.01.2013

This need to be like this:
pawn Код:
mysql_function_query(mysql_Account, query, false, "IsResultExist","i",playerid);
If you don't need return of playerid use something else.


Re: why mysql callback doesnt process? - coakiddo - 23.01.2013

You disabled cache.
Код:
mysql_function_query(mysql_Account, query,true, "IsResultExist","i",playerid);
Код:
public IsResultExist(handleid)
{
    new rows,fields;
    cache_get_data(rows,fields);
    if(rows)
    {
    }
    else
    {
    }
    return 1; // No need for mysql_free_result if you return it.
}



Re: why mysql callback doesnt process? - yxliang - 23.01.2013

Quote:
Originally Posted by coakiddo
Посмотреть сообщение
You disabled cache.
Код:
mysql_function_query(mysql_Account, query,true, "IsResultExist","i",playerid);
Код:
public IsResultExist(handleid)
{
    new rows,fields;
    cache_get_data(rows,fields);
    if(rows)
    {
    }
    else
    {
    }
    return 1; // No need for mysql_free_result if you return it.
}
You think I must enable cache to use mysql_function_query? But I have seen the a_mysql include
Код:
#define mysql_query(%1,%2,%3,%4) \
	mysql_function_query(%4,%1,false,"OnQueryFinish","siii",%1,%2,%3,%4)
So I think I don't need use cache.


Re: why mysql callback doesnt process? - yxliang - 24.01.2013

Quote:
Originally Posted by coakiddo
Посмотреть сообщение
You disabled cache.
Код:
mysql_function_query(mysql_Account, query,true, "IsResultExist","i",playerid);
Код:
public IsResultExist(handleid)
{
    new rows,fields;
    cache_get_data(rows,fields);
    if(rows)
    {
    }
    else
    {
    }
    return 1; // No need for mysql_free_result if you return it.
}
I tried to enable cache but I got same result.