asked on
<div id="tlist">
<?php
$result = mysqli_query($con, "SELECT tbl_therapist.therapist_id, tbl_therapist.therapist_name FROM tbl_therapist ORDER BY therapist_name ASC;");
?>
<label><strong>THERAPIST</strong></label><BR>
<select name="my_therapist" id="my_therapist" size="10">
<?php
while ($row = mysqli_fetch_array($result)) {
printf("<option value='%s'>%s</option>", $row['therapist_id'], $row['therapist_name']);
}
?>
</select>
</div>
<div id="results">
<?php
$result = mysqli_query($con, "SELECT tbl_client.client_id, tbl_client.client_name FROM tbl_client INNER JOIN tbl_therapist_client
ON tbl_therapist_client.client_id=tbl_client.client_id WHERE tbl_therapist_client.therapist_id = $therapist_id ORDER BY client_name ASC;");
?>
<label><strong>CLIENTS</strong></label><BR>
<select name="my_clients" id="my_clients" size="10">
<?php
while ($row = mysqli_fetch_array($result)) {
printf("<option value='%s'>%s</option>", $row['client_id'], $row['client_name']);
}
?>
</select>
</div>
The left one is therapist. the right one clients