Raised This Month: $ Target: $400
 0% 

Compare Array Question


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 03-14-2006 , 10:00  
Reply With Quote #5

You only want the matching records from SQL, correct?

I haven't tested the code below but what it's intended to do is create a where clause containing each of the STEAM_ID's you're looking to match. It then only pulls the records from the table that do match. Therefore, the number of matches will be equal to the new of records returned from the query.

Code:
    new authID[32]     new players[32], inum, playerID         get_players(players,inum)         //Find All Admins On Server and Store SteamID in where string     for (new i = 0; i < inum; i++){         playerID = players[i]         if( get_user_flags(playerID)){             get_user_authid(playerID,authID,31)             format(whereClause, 1023, "%s OR auth = '%s'", whereClause, authID)         }     }     copy(whereClause, 1023, whereClause[4])     //Retrieve All Admins From SQL Database and Store In Array     new adminName[100]     new j = 0         result = dbi_query(dbc,"SELECT auth,name FROM admins WHERE %s", whereClause)         while( j < dbi_num_rows(result)){         dbi_nextrow(result)         dbi_result(result,"auth",steamSQL[j])     }
Brad is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:16.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode