Hello, Please help me to fetch data from bottom member. here is a picture give below. I want to get all information within my network as picture shows using PHP MySQL Please help Me. Thanks
Thank you for your reply. I have made a sample database only have user_ID (primary),Username, Referance_ID. Is this alright? I want when i click ones id all member of his/her network will be shown.As this picture you see that there is some level of member i actually want to fetch data from this levels. Thanks Again.
hmm you are storing USER_ID(primary key), USER_NAME and REFERENCE_ID i think with reference id you means that under which user does the current user comes ??? if i am right then for the current scenario pseudo code will be like.. first of all display all users like in pic and give a hyperlink to them as 'index.php?id=' . $user_id $user_id is fetched from database.... then when some one click on that user use the following query.. $result=mysql_query('SELECT * FROM user_table where reference_id=' . $_GET['id'] ); i hope you understood the logic....
Hello, Thanks For reply. Actually i want to know how can i get the level of the user? On the picture second line of man is first level , third lne is second level...and so on. I want to know which user is my second level and which is in third level and so on... Please help me. Thanks
Hello, Thanks for reply. But where i use level field in database? Would u please advice me for database? Thanks
When the new user add on my network direct referral will be in my first level and so on... How can i find second level, third level, fourth level and so on? Is that clear now?
Dear sakayhin yes you are right by default its will be on first level. for that you need to define these all levels on your website admin area, Please make the Edit member area and retrieve your all levels from database to drop down and from there you can change user levels on your wish or user request maybe its help.
Now you clarified the requirement. So for this make another field 'level' in the table. By default it will be 1 if 'reference_id' is NULL but if there is any 'reference_id' then retrieve the level of the user having user_id equal to that reference_id and add 1 to that level. This will be the level of the new user... I hope you understood what i tried to tell....