I'm new to PHP and SQL and would like to know what is the best solution to my issue.
I currently have a PHP page (profile.php) that contains the following three select queries:
$academic = "SELECT * FROM t12019 WHERE `Student ID` = {$id}";
$resultb = mysqli_query($conn,$academic);
$stoplight = "SELECT * FROM t1stoplight19 WHERE `Student ID` = {$id}";
$resultc = mysqli_query($conn,$stoplight);
$attendance = "SELECT * FROM t1attendance2019 WHERE `Student ID` = {$id}";
$resultd = mysqli_query($conn,$attendance);
$id
comes from a $_POST
selection from the previous page.
the tables for each query is coded in, however, I would like them to be a variable that can be updated from a dropdown selection on the page.
What I imagine, is a selection box on the profiles.php where a user can select one of 'Term 1','Term 2', 'Term 3', 'Term 4'. The tables for each query will then be updated accordingly for the selection.
Any help appreciated.