count all left and right nodes

What do you have so far?

i have count for first level of child , but i need all child count for the parent

What is the output you are expecting?

every ID with all childs for example
(Parent) ikrami
(Left) karim
(Right) hady

so i need to get for ikrami in left column ( Karim and all childs left or right from karim ) and in column right ( hady and all childs left or right from hady )

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.