Daniel Israel
03-25-2010, 09:23 PM
I have 2 arrays. They both represent data returned from a database query. Each array item is an array (row of data in the database).
What I'd like to do is to merge the arrays, but to remove duplicate IDs (which is not the array index...)
I know.... Why?
I'm keeping a calendar. I want to list the next X items in the calendar. The first array is a list of recurring events (every Tuesday, every 15th of the month, etc...) and the second list is the one-time events. The catch is that a one-time event can over-ride an instance of a recurring event. (For example, if I have a class every Tuesday night, I set that as a recurring event. I can then enter a one time event (say, going to my niece's play) and when I list the events, the play comes up instead of the class for that evening...)
Right now, what I'm doing is going through the array items one by one and checking the values, then replacing them. Is there an easier way to do this?
Thanks.
What I'd like to do is to merge the arrays, but to remove duplicate IDs (which is not the array index...)
I know.... Why?
I'm keeping a calendar. I want to list the next X items in the calendar. The first array is a list of recurring events (every Tuesday, every 15th of the month, etc...) and the second list is the one-time events. The catch is that a one-time event can over-ride an instance of a recurring event. (For example, if I have a class every Tuesday night, I set that as a recurring event. I can then enter a one time event (say, going to my niece's play) and when I list the events, the play comes up instead of the class for that evening...)
Right now, what I'm doing is going through the array items one by one and checking the values, then replacing them. Is there an easier way to do this?
Thanks.