I have a code that displays data from Mysql database. I want that when a user clicks on one of the fields drawn from the database, the database should display corresponding results of that ID.
As you can see in the code below, the code loops through data in the database and select std_id and std_name and display them in an HTML table within a form. I want that, when a user clicks on the button it should display other data in another page such as age, adress, phone... What code would I need to write? Your support will be greatly appreciated.
//these variables are from a form used to display the current data
$level = $_POST['level_group'];
$room = $_POST['room_group'];
// Check connection
echo "Failed to connect to MySQL: " . mysqli_connect_error();
$result = mysqli_query($con,"SELECT std_id, std_name FROM students WHERE std_level LIKE '$level%' AND std_room LIKE '$room';");