SA-MP Forums Archive
MySQL Help, how do I get the results of this query? - 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 Help, how do I get the results of this query? (/showthread.php?tid=633469)



MySQL Help, how do I get the results of this query? - Dokins - 01.05.2017

pawn Код:
format(query, sizeof(query), "SELECT `CSlot1`, `CSlot2`, `CSlot3`, `FSkin` `SkinSlot` FROM `accounts` WHERE id IN(%d, %d, %d, %d)", AccID[playerid][0], AccID[playerid][1], AccID[playerid][2], AccID[playerid][3]);
    mysql_tquery(dbHandle, query, "GetMASkinSlot", "si",pPass[playerid], playerid);
I thought it may be something like this, but it doesn't get any results.
pawn Код:
forward GetMASkinSlot(intext[], playerid);
public GetMASkinSlot(intext[], playerid)
{
    AccIDSkinUsed[playerid][0] = cache_get_row_int(0, 4);
    AccIDSkinUsed[playerid][1] = cache_get_row_int(1, 4);
    AccIDSkinUsed[playerid][2] = cache_get_row_int(2, 4);
    AccIDSkinUsed[playerid][3] = cache_get_row_int(3, 4);//SKIN SLOT USED FOR ALL 4 ACCOUNTS (possible).



Re: MySQL Help, how do I get the results of this query? - Dokins - 02.05.2017

Bump?


Re: MySQL Help, how do I get the results of this query? - iLearner - 02.05.2017

PHP код:
AccIDSkinUsed[playerid][0] = cache_get_row_int(04);
    
AccIDSkinUsed[playerid][1] = cache_get_row_int(14);
    
AccIDSkinUsed[playerid][2] = cache_get_row_int(24);
    
AccIDSkinUsed[playerid][3] = cache_get_row_int(34);//SKIN SLOT USED FOR ALL 4 ACCOUNTS (possible). 
Quote:

Syntax: cache_get_row_int(row, field_idx, connectionHandle = 1)

for example to get value of CSlot1 and FSkin:
PHP код:
AccIDSkinUsed[playerid][0] = cache_get_row_int(0"CSlot1");
AccIDSkinUsed[playerid][1] = cache_get_row_int(0"FSkin"); 



Re: MySQL Help, how do I get the results of this query? - Dokins - 02.05.2017

That's the incorrect syntax.


Re: MySQL Help, how do I get the results of this query? - Dokins - 02.05.2017

Still unresolved