I Have 1 Drop Down Which Is Used For Category (Food, Drink etc)
In my MYSQL Table (t_menu_category) I Have :
+----+---------------+------------------
you could create a PHP file with the request and call it with AJAX.
getSubCategory.php
getMessage();
}
$sql = 'SELECT sub_category_name as subCategory FROM t_menu_category WHERE category_name = :category';
$stmt = $dbh->prepare($sql);
$stmt->bindValue(':category', $category);
$stmt->execute();
return json_encode($stmt->fetchAll());
and add some jquery to catch when an category is selected and ask the server for the corresponding sub-category:
also add a value on your first option: