Forum Academy Marketplace Showcase Pricing Features

How to add a variable from the page to sql query?

Hi all,

I want to add a query from my postresql database where I want to query per specific parameter which will be on that page.

I am creating a match page and when I click on a certain match I get redirected to another page for that specific teams where I have home team and away team.
I want to add a query to add a home team name as a variable.