How to use URL parameters in Mysql queries to achieve Drill Down mechanism?

I have created a Field value using Variables in Grafana dashboard and passed by data link .
I am able to pass it in the URL but i want to access the same in the Mysql Query
I am trying to achieve a Drill down mechanism.
And want to pass that filter(from the URL) in the child Dashboard panel

Sample : http://localhost:3000/d/E8oz3cMGk/drilldown?editPanel=6&orgId=1&from=1593764427317&to=1593786027317&viewPanel=6&p=sampleFeild

I want to use value of ‘p’ in my MySql Query
Query : - Select client_id from sampleTable where feild = ‘$p’ limit 10

i am not able to set the value from URL to the feild variable in Query.

Thanks in Advance

Facing the same issue here, have you found a solution?

Did you find the solution?