I'm working on a system with affiliate logic behind, with up to 3 levels in the structure. I've got it working for 2 layers perfectly already. Here is the code I used for 2 layers. I'm using fat free Framework as a PHP Framework, shouldn't matter too much there though (think the code should be understandable without knowledge of the framework as well)... PHP: $firstLevel = $db->exec('SELECT * FROM users WHERE sponsorID=:sponsorID',...
Originally asked by nameless on Stack Exchange (stackoverflow) (CC BY-SA 4.0).