![]() |
Right Join Query Problem - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Right Join Query Problem (/showthread.php?tid=55966) |
Right Join Query Problem - El Forum - 11-19-2012 [eluser]rochellecanale[/eluser] Hello guys actually it is not a CI problem. But I hope you can help me. My problem is all about query. I tried all my best but i give up. Here's my tables Code: mysql> desc member; My goal is to get all the downline member of a certain user using the fields member_id(from table member), username(from table member) level (from downline member). Example: When i click the button Account History it list all the transactions together the earned points(used in virtual wallet) and payouts (income). And if i click the EARNED it drilldown all my member downline. An it redirect to other page showing my member in a specified level. Right Join Query Problem - El Forum - 11-19-2012 [eluser]solid9[/eluser] This is not hard, this is a One to Many relationship tables. You need to convert your DownLine table from this, Code: +----------+------------------+------+-----+---------+----------------+ to this table, Code: +----------+------------------+------+-----+---------+----------------+ Noticed the newly added member_id column. I don't think you need the fkmember column? All you need is the member_id from member table and copy that into DownLine table. The rest are easy. Right Join Query Problem - El Forum - 11-19-2012 [eluser]solid9[/eluser] The question is how do you compute earned points(used in virtual wallet) and payouts (income)? Right Join Query Problem - El Forum - 11-19-2012 [eluser]rochellecanale[/eluser] I have a specifc code for that every level it required an amount of recruited member. Thanks for the answers |