In laravel i could do this by assuming that there is a relationship between the two tables child and parent.
I could access how many times is parent using the child.
$child->parent->id;
but in pure PHP i have no idea how that works. So far i`ve only tried this
foreach ($shops as $shop) {
foreach ($shopAssistants as $shopAS) {
if($shopAS['shop_id'] != $shop['id']){
?>
<option id = "<?php echo $shop['id']; ?>"><?php echo $shop['shop_name']; ?>
</option>
}