How to get distinct results joining 3 MySql tables in Codeigniter? |
I have three tables in my database. See my tables--
[color=var(--highlight-color)]Users Table: [/color] Code: user_id name email phone password role Code: Flats Table: [color=var(--highlight-color)]Payments Table: [/color] Code: pay_id flat_id month_from month_to amount date When I join these table using this code: Code: $db = \Config\Database::connect(); I get these results: Code: FlatNumber User PaidUpto LastPaid According to my requirement, the result shouldn't have duplicate User or FlatNumber. There should be results equal to the number of User in users table.. Plz suggest me changes in my Join Query. Thanks in Advance!
I know this is late but may help someone
PHP Code: $db = \Config\Database::connect(); |
Welcome Guest, Not a member yet? Register Sign In |