I have a table with different fields, but I want to display the results of two fields and one contains duplicate values. Consider:
F1 | F2
-----------------
m1 | manchester
m2 | manchester
cm3 | london
k4 | birmingham
I want the result in such a way that if I press m
m1
m2
cm3
manchester
birmingham
I am new to php & mysql
You can use a union query to get what you want like this:
Edit: This will automatically remove duplicates as shown below: