dimanche 21 décembre 2014

How can I update the amount on parentid


I'm using MySQL database,This is the first time that i handle this kind of project the Multi-Level Marketing.I am having problem in updating the amount of parentid if he gets paired means he has left and right child,also if his children get paired,he also be given the amount (example) 500.and the parent of his childrend.



CREATE TABLE `geneology` (
`parentid` INT(11) NOT NULL,
`memberid` INT(11) NOT NULL,
`position` CHAR(1) NOT NULL,
`amount` DECIMAL(10,2) NOT NULL
)
COLLATE='latin1_swedish_ci'
ENGINE=MyISAM
;


parentid memberid position amount

0 1 0.00

1 5 L 0.00

1 6 R 0.00

5 7 L 0.00

5 8 R 0.00

7 9 L 0.00

7 10 R 0.00

9 11 L 0.00


Thank you in advance.





Aucun commentaire:

Enregistrer un commentaire