I’m building a project for users to search for businesses in their local area.
I’m struggling with pulling data from the database from the landing page. E.g. a user visits landing page, they then enter name, email and select their ‘town’ from the dropdown, then hit ‘search’.
The user is then re-directed to a new page, where I want to display the prices and available dates of any business that has coverage in the area selected in the dropdown.
I’ve been playing around with sending data to the redirected page via url. Then using that parameter as like a filter within a dataset, but it doesn’t seem to show me the right data from this. I’m wondering if my database is setup correctly (see below) or if I’m doing something wrong.
The database looks like this:
Business
- Email (text)
- Name (text)
- Phone Number (text)
Collection Dates
- Business (links to Business)
- Available-Status (yes/no)
- Collection Date (date)
Coverage Area
- Business (links to Business)
- Region (text)
- Town (text)
Town Capacity
- Business (links to Business)
- Capacity (number)
- Date (links to Collection Dates)
- Towns (links to Coverage Area)
Size Pricing
- Business (links to Business)
- 6ft Price (number)
- 8ft Price (number)
To summarise this, I’m trying to find a ‘Town’ from user dropdown in the database that matches a ‘Town’ that the business has in their ‘Coverage Area’, which should then allow me to show ‘Collection Dates’ and additionally see ‘Size Pricing’ for the business in that ‘Coverage Area’.
Any help appreciated!