1
I have the establishment table, unit table and professional table. In the unit table, I have the idestablishment. On the professional table, I have the skill. I need to pull all the professionals' ID from 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);
?>
I tried your 1st. suggestion and it worked. Thanks.
– GustavoSevero