I have a mySQL table containing stores. It looks like this:
id | name | city
1 | H&M | New York
2 | Gucci | New York
3 | H&M | Chicago
4 | H&M | Boston
5 | Gucci | Las Vegas
6 | Cavalli| New York
7 | H&M | Phoenix
I have a drop-down menu that I want to be looking like this:
- Home
- Stores
- New York
- Chicago
- Boston
- Las Vegas
- Phoenix
My question is: How do I fetch, without repeating, the cities I have stores in so I can make each of them a hyperlink in my drop-down menu like this: mypage.com/city/new-york
. The page it will lead to, will obviously contain the stores where city='$_GET['city']'
.