hi,
im doing calculation in hierarchical way below are my details
CREATE TABLE `nodes_1` (
`parent` int(11) DEFAULT NULL,
`child` int(11) DEFAULT NULL,
`marks` int(11) DEFAULT NULL
)
data:-

in a query if i pass 5 as parent that calculate 2,3 child marks
and the same if i pass 15 as parent that should calculate 10,5 marks --5 already having 2,3 child. Result would be 200
same if i pass most parent 38 it should calculate 15,17,6 child marks --15 already holding 200 marks ,17 has two childs 9,8 marks ,6 no marks --result 230 e.t.c
thanks in advance.