mercredi 5 août 2015

How can i count the all the children & grand children until to the 7th level in PHP or mysql query


I have 3 tables right now

 1. members
 2. members_parents
 3. members_status

How can i count the children & grandchildren until to the depth level and separate the count() for the status 0 = free and 1 = subscriber

table: members - list all the records of members
table: members_parents - list of members & the parent member
table: members_status - list the members & parents status where 0 or 1

tbl_members_parents:
id     member     parent
1    10000      NULL
2    10001      10000
3    10002      10001

and so on.. how can i count the child & grandchildren until to the 7th level of grand children. thank you.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire