wsantos Posted November 23, 2007 Share Posted November 23, 2007 I have data that reflects the stages of the system a connection passes. Now that stage can be any of the applications present in the system that may have different data. As an example lets take a single connection. app1|app1data1 --> app2|app2data1 --> app1|app1data2 --> app3|app3data1 --> app2|app2data2 There is no finite number of stages it may go through. Also there is no definite order what stage will it fork to. As an example there are 10 total incoming. Of the 10 incoming 5 went to app1 with data app1data1 then 3 of the 5 went to app2 with data app2data2. The remaining 2 went to app3 with data app3data1. The remaining 5 of the original 10 incoming went to app2 with data app2data2 (note this is the 2nd stage of the first 5 which can be the third stage or whatever). Since I could not find a way to group it via mysql I put everything in an array. I got the total number of incoming and the stage and stage data it terminated. Now my goal is to trace the total incoming and trace which stages it will go through until termination. Any help is much appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/78513-grouping-an-array/ Share on other sites More sharing options...
wsantos Posted November 23, 2007 Author Share Posted November 23, 2007 Bump ... do me a favor folks...can you bump this when you log off...Thanks Quote Link to comment https://forums.phpfreaks.com/topic/78513-grouping-an-array/#findComment-397383 Share on other sites More sharing options...
BenInBlack Posted November 23, 2007 Share Posted November 23, 2007 this might help http://www.php.net/manual/en/function.array-walk-recursive.php I wish you had a sample output of this array, I really like to have data to play with ;-) Quote Link to comment https://forums.phpfreaks.com/topic/78513-grouping-an-array/#findComment-397386 Share on other sites More sharing options...
GingerRobot Posted November 23, 2007 Share Posted November 23, 2007 What does the mysql table look like? Im a little confused as to how you arrive with this information. Do you have an ID for each connection and a record for each stage perhaps? Maybe if you post the array you have and the array you would like it would help. Quote Link to comment https://forums.phpfreaks.com/topic/78513-grouping-an-array/#findComment-397399 Share on other sites More sharing options...
wsantos Posted November 23, 2007 Author Share Posted November 23, 2007 |Main| |lookup_cid| |path| |lookup_exten| |lookup_app| mid rid pid etc etc uid................uid appid ...................................appid src cid................cid etc etc dst etc eid .............. eid etc etc appdata etc The structure seems logical. However the source of the data is unconventional in a sense that they (the company) may bypass a stage 1 and proceed with stage 2 then go back to stage 1. I used 'stage' referring to a section of their system and not literally by order. Thanks BenInBlack...I'll look into this. Quote Link to comment https://forums.phpfreaks.com/topic/78513-grouping-an-array/#findComment-397551 Share on other sites More sharing options...
wsantos Posted November 25, 2007 Author Share Posted November 25, 2007 *BUMP* Quote Link to comment https://forums.phpfreaks.com/topic/78513-grouping-an-array/#findComment-398536 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.