Have you tried using the data in the url to write different queries ?
Something like:
if (data1) {select data1 from database} elseif(data2){select data2 from database}
and so on ? This is what a CMS does actually it, shows different data on the same page based on the url parameters which in php you can use as $_GET['data1']
or $_REQUEST['data1']
Try something like that then update your answer with some code.