DEV Community

loading...

PHP MYSQL URL Filtering

labslingua profile image AI E8 ・1 min read

Hi everyone.
I have a database that I would like the user to be able to filter using a drop down which will then take the user to a new page with the filtered parameters carried on the URL. Example:

Database contains 3 columns (Spain, France, Germany), rows are cities such as:
For Spain: Madrid, Barcelona
For France: Paris, Marseille
For German: Berlin, Koln

I would like that when the user picks using a drop-down: Spain and France, they will be taken to a URL such as: www.example.com/country=france&country=spain
in that link they will see only France and Spain and their city in a table.
So total will be 3 elements: (mysql database, page1 with drop down list, page2 with table with the filtered data).
Can anyone help with this? Thank you so much!!!

Discussion (0)

pic
Editor guide