<?php
include('config.php');

if (isset($_POST['distict_id'])) {
    $distictId = intval($_POST['distict_id']);
    $blocks = $db->getRows("SELECT * FROM block WHERE distict_id = $distictId ORDER BY id ASC");

    echo '<option value="0">Select Block</option>';
    foreach ($blocks as $block) {
        echo '<option value="' . $block['id'] . '">' . $block['block_name'] . '</option>';
    }
}
?>