I have the table establishment, table unit, and table professional. In the unit table, I have idestablishment. On the professional table, I have the idunity. I need to find all the data of the professionals by the id of the establishment. Another thing, the establishment has N units and each unit has N professionals.
PHP:
<?php$idestabel=$_GET['idestabel'];$getUnits=$pdo->prepare("SELECT idunidade, unidade FROM unidade WHERE idestabelecimento=:idestabel");
$getUnits->bindValue(":idestabel", $idestabel);
?>