SA-MP Forums Archive
Help MySQL R7 - 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: Help MySQL R7 (/showthread.php?tid=383761)



Help MySQL R7 - Edvin - 08.10.2012

Hello,Do you know how to count Mysql r7 with return? How get value from the callback function of mysql and after return in the general function.


Re: Help MySQL R7 - ReneG - 08.10.2012

PHP код:
stock fetchCount(playerid)
{
    
mysql_function_query(handle"SELECT COUNT(*) FROM `table`"true"OnCountRetrieve""i"playerid);
    return 
1;
}

forward OnCountRetrieve(playerid);
public 
OnCountRetrieve(playerid)
{
    new 
content[10];
    
cache_get_field_content(0"COUNT(*)"contenthandle);
    
    new 
string[128];
    
    
format(stringsizeof(string), "The table has %d rows inside it."strval(content));
    
SendClientMessage(playerid, -1string);
    return 
1;

If that's not what you mean, then be more specific, I'd be glad to help you out.