Perform 2 Right Joins In Query |
[eluser]rochellecanale[/eluser]
Hello guys I need your help this is not a CI problem but I hope you can help me. I have a 3 tables named (member,downline and points_ledger) Code: Here's the structure My problem is i can only join two queries the member and the points_ledger but when i add the downline table it results to ambiguous fkmember. How can i create a join query? Hope you can help me.
[eluser]adamck[/eluser]
To save some time, could you send me an export of some example data with the table structure in a .sql file. OR export the test data to a .sql and paste the .sql contents to a pastie or any other way, its hard to create a complex query without the test data to play with This way i can import it to phpmyadmin and test some queries on it. Im fairly sure i have a solution, but i need to test it Ad.
[eluser]adamck[/eluser]
Hmm the forum download wont work, just gives me a blank page... Can you email it me [email protected]
[eluser]adamck[/eluser]
Yes thanks. Ill have a look now. Do you want the query to give a single row result based on an ID? Or do you want all the rows from the member and points_ledger and then the level from downline if it exists? Adam.
[eluser]rochellecanale[/eluser]
The second one. Thanks Adam for answering my problem. Just give me a sample query so that i can test too. Ok got to go. Thanks again.
[eluser]adamck[/eluser]
Hmm something like this? Code: SELECT
[eluser]rochellecanale[/eluser]
It results to: Code: +-----------+----------------+----------------+-----------------+------------------+---------------------+--------+--------+-----------------+----------+-------+ yeah that's what i need but the running balance is incorrect it should be the sum of one account for example i have an account. All I need is to get to know the sum of my running balance. Take a look at member 'ssssssssssss' the sum of his account should be 5.00 and the sum of running balance is 5.00 also. Thanks for the answer it will really help me a lot. Keep up the good work my friend.
|
Welcome Guest, Not a member yet? Register Sign In |