<label>Filter by therapist clients</label>
<?php
$sql = <<< EOT
SELECT tbl_client.client_id, tbl_client.client_name
FROM tbl_client
JOIN tbl_therapist_client
ON tbl_therapist_client.client_id=tbl_client.client_id
JOIN tbl_session
ON tbl_session.client_id=tbl_client.client_id
WHERE tbl_therapist_client.therapist_id = $therapist_id
AND tbl_session.session_status = "Paid"
GROUP BY tbl_client.client_id
ORDER BY tbl_client.client_name ASC;
EOT;
$results = $db->query($sql);
echo "<select name='myClients'>";
echo "<option value='0'>Show All</option>";
while ($row = $results->fetch(PDO::FETCH_OBJ)) {
printf("<option value='%s'>%s</option>", $row->client_id, $row->client_name);
}
echo "</select>";
?>
From thisNetwork and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.