Compare Array Question
hi
i have 2 arrays one called admins[32] and one called adminSQL[100] i need to compare these arrays and cant get my head around how :( admins[32] stores the steam id of any admins on the server adminSQL[100] stores all the admin steamids from "auth" field how would i compare these 2 arrays since SQL could have anywhere from 1 admin to 100 admins and the server could have 32 admins on it. heres what i got so far Code:
someone help please :) |
heres what iv got so far. dont know if it works but im guessing it wont.
any suggestions on how to make it work? Code:
|
works if theres only one person on the server.
if theres more then it just prints a whole bunch of ='s with some random letters |
Show the output and the database files, so maybe we can get a better look at the problem you're having.
Also, to make things easier to read, I'd use a for loop within a for loop, instead of two whiles: Code:
|
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:
|
cool, thanks will give it a try when i get back :)
|
been workin on this and it still doesnt work.
if im admin in slot #1 it works but if im in #2 then i just does nothing. cant figure out why heres what i got so far that seems to work when im in #1 Code:
|
Are you trying to be inefficient with your code? Also, you're more likely to get help if you post the entire plugin so that others can make/test changes.
|
Code:
as for effiency i cant think of any other way of doing it. |
Quote:
Quote:
|
| All times are GMT -4. The time now is 20:15. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.