I want to get categories and its forms and also user’s form which he selected but my query getting double record for those forms which user selected. my query is this.
SELECT forms.* , cat.category_title,cat.type,ufrm.formID FROM tbl_tax_forms as forms
INNER JOIN tbl_form_categories as cat ON cat.id= forms.cat_id
LEFT JOIN tbl_client_forms as ufrm ON ufrm.formID=forms.id
WHERE forms.cat_id =1 order by forms.cat_id ASC,forms.id ASC
my Result is as follow
form_title category_title type formID
Single Individual Tax Return 1 1
Single Individual Tax Return 1 1
Married Filing Separately Individual Tax Return 1 NULL
Married Filing Jointly Individual Tax Return 1 NULL
user selected formID 1 with title Single so this is repeating twice. this should be also display one record.
Please help with thanks