<?php
include($_SERVER["DOCUMENT_ROOT"].'/anunturi/config/database.php');
$cat_id = $_POST["cat_id"];
$result = $dbc->query("SELECT * FROM `scategorii` WHERE `cat_id`=$cat_id");
echo '<option value="">Selectați o sub-categorie</option>';
while($row = $result->fetch_array()) {
    echo '<option value="'.$row["scat_id"].'">'.$row["titlu"].'</option>';
    }
?>