In this system if A refers B then A will get certain commission of referral and if B refers C then the same happens with B but this time a certain amount also goes to A so it does kind of work on parent child chain model and it will work up to 10 levels
I am making this project on php and I am really struggling with the database design so it will be really helpful if anyone can share their ideas😊
j
stuff ;)
web.archive.org/web/20110606032941/http://dev.mys… ? maybe this will help?
I can think about several solutions in architecture, personally I would create a referal table with a double primary key 'ref_id' + 'referer_id' where ref_id so you can have things like
| ref_id | referer_id | parent_id | | 1 | 1 | null | | 1 | 3 | 1 |so you have the tree reference outside the main table but it's a lot about design and this is just one solution I came up with on the spot right now.
There most likely are better solutions.