Welcome Guest, Not a member yet? Register   Sign In
Merging arrays from different queries
#3

[eluser]JanDoToDo[/eluser]
Nick,
Thanks a lot for your reply. I did it in the end with merge_array_recursive. For each of the arrays i created a new key/value pair called "sort_date" for each of the array rows (like you have done but you ahve just unset/reset the value) and then i array_merged_recrsive to get them all into one array. I thought it might not work as different array rows have different fields, i.e. some are members/threads etc however it has worked fine. The only thing ive noticed is that I have a 2d sort algorithm and if i use it to sort by the date it doesnt work so i have to convert the date into a timestamp, sort the array and then convert it back into a date! Apart from that it is all working perfectly now :-) thankyou!

Ultimately, when I make everything tidier I will just select the date column in mysql as a different name so that i dont have to do it in PHP. Then all I ahve to do is merge recursive. Cheers Nick!


Messages In This Thread
Merging arrays from different queries - by El Forum - 08-30-2010, 08:16 AM
Merging arrays from different queries - by El Forum - 09-02-2010, 12:49 AM
Merging arrays from different queries - by El Forum - 09-02-2010, 01:51 AM
Merging arrays from different queries - by El Forum - 09-02-2010, 07:57 AM
Merging arrays from different queries - by El Forum - 09-02-2010, 08:58 AM
Merging arrays from different queries - by El Forum - 09-02-2010, 12:39 PM
Merging arrays from different queries - by El Forum - 09-02-2010, 12:46 PM



Theme © iAndrew 2016 - Forum software by © MyBB