<?php
include "connect.php";

if(isset($_POST['get_option'])){
   $id = $_POST['get_option'];

   $query = "SELECT * FROM positions WHERE departmentid = $id";

   $result = mysqli_query($db,$query);

   if ($count !== 0) {

      while ($rowposition = mysqli_fetch_array($result)) {

         echo "<option value ='" . $rowposition['positionid'] . "'>" . $rowposition['positionname'] . "</option>";

       }

   }

   die;
}