monkeytooth Posted July 2, 2011 Share Posted July 2, 2011 Ok I have a hand full of Arrays I have one that is built based on one query. That has name, email in pairs its a 3D array example Array( [Errors] = none, [listed] = Array( array(username1, email1) array(username2, email2) array(username3, email3) array(username4, email4) array(username5, email5) array(username6, email6) array(username7, email7) ) ) Off that same query I have another array that is just the email address's that I use to query my DB for to see if they are already in that DB. array(email1,email2,email3,email4,email5,email6, email7) I am querying my DB using the IN() function base off the emails in the second array shown above. This query will return email addresses already in my system. Now what I am trying to do overall is create 2 separate arrays. One that is a list of the username/email that's in the system the other that's a list of the username/email that's not in the system. Anyway the first array set I shown is the array I have to ultimately shuffle around.. I'm guessing something as simple as just removing any given array that's a matching email for already in the system leaving whats not in that array behind and using that as my "not in system" array. However it being a 3D array like it is I am stuck as to how I should approach this obstacle so I can remove the sets of data as needed and push them or whatever into another new array. So here I am looking for ideas and suggestions. Quote Link to comment Share on other sites More sharing options...
Psycho Posted July 2, 2011 Share Posted July 2, 2011 You should reconstruct your first array so the username is the key and the email is the value. You can then use one of the array_dif() functions on the results of a query for matching emails. I think you are making this more complicated than it needs to be. It would be helpful to see some of the relevant code you have. Quote Link to comment Share on other sites More sharing options...
monkeytooth Posted July 2, 2011 Author Share Posted July 2, 2011 good point, didn't think of that.. Quote Link to comment Share on other sites More sharing options...
monkeytooth Posted July 2, 2011 Author Share Posted July 2, 2011 actually just thought of something however.. sometimes the username to be displayed is the same as the email address.. or is empty.. in both cases I change it to "none" where when it comes to the display if that name is none.. then it shows slightly differently.. how would that effect me? Quote Link to comment Share on other sites More sharing options...
Psycho Posted July 2, 2011 Share Posted July 2, 2011 actually just thought of something however.. sometimes the username to be displayed is the same as the email address.. or is empty.. in both cases I change it to "none" where when it comes to the display if that name is none.. then it shows slightly differently.. how would that effect me? Your "question" is really just a generalized question since you haven't provided any code. There is an infinite number of ways to accomplish the same thing and I can't provide any relevant solutions without seeing some code. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.