Параметры динамического выбора php и mysql

Я знаю, что этот вопрос задавался много раз, но я пробовал в течение нескольких часов и ничего не работал, я ноб с php и ajax, поэтому я мог бы пропустить небольшую вещь, о которой я не знаю, что я пытаясь достичь здесь, я хочу, чтобы пользователь выбрал группу продуктов питания, и на основе этого будет отображаться список ингредиентов.

Я тестировал свой файл process.php один, и он работает хорошо, я также проверил скрипт, что происходит, так это то, что строка, начинающаяся с $ .ajax, не работает, когда я прокомментирую ее и набираю alert (parent). Я действительно получаю значение выбранного параметра, так что я делаю неправильно здесь? или мне не хватает импорта? PS Я использую bootstrap 3.0 для дизайна

Вот мой html-код

<!-- field food group--> <div class ="field form-group"> <label for="food-group"> Food Group * </label> <div class="input-group input-group-lg"> <select class="form-control" id="food-group-id" name="food-group" onchange="ajaxfunction(this.value)"> <?php // retreiving the recipe groups $RecipeGroup = new FoodGroup(); $data = $RecipeGroup->findAll(); foreach ($data->results() as $recipegroup) { // displaying the options echo '<option value="'.$recipegroup->food_group_id.'">'.$recipegroup->food_group_name.'</option>'; } ?> </select> </div> </div> <!-- field Ingredients--> <div class ="field form-group"> <label for="ingredients"> Ingredients * </label> <div class="input-group input-group-lg"> <select class="form-control" id="ingredients"> <?php // retreiving the recipe groups $ingredients = new Ingrident(); if(Input::exists()){ $data = $ingredients->findByGroup(Input::get('food-group')); }else $data = $ingredients->findByGroup(1); foreach ($data->results() as $ingredient) { // displaying the options echo '<option value="'.$ingredient->ingrident_id.'">'.$ingredient->ingrident_name.'</option>'; } ?> </select> <br> <br> <br> <span id="helpBlock" class="help-block center">Ingredient not listed ? <button class="btn btn-primary center" value="add-ing"> <span class="glyphicon glyphicon-plus"></span> Add New Ingredient </button> </span> </div> </div> 

Вот мой сценарий

 <script type="text/javascript"> function ajaxfunction(parent) { $.ajax({ url: 'process.php?food-group=' + parent; success: function(data) { $("#ingredients").html(data); } }); } </script> 

Вот мой файл process.php

 <?php mysql_connect('localhost', 'root',''); mysql_select_db("online_recipes"); $result = mysql_query("SELECT * FROM `ingrident` WHERE `food_group_id_fk` = " . mysql_real_escape_string($_GET['food-group'])); while(($data = mysql_fetch_array($result)) !== false) echo '<option value="', $data['ingrident_id'],'">', $data['ingrident_name'],'</option>'; 

Список моего импорта

 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="http://code.jquery.com/jquery-2.1.1.min.js"></script> <script src="js/bootstrap.min.js"></script> <script src="js/docs.min.js"></script> <script src="js/ie10-viewport-bug-workaround.js"></script> 

 $.ajax({ url: 'process.php', type:'post', data: {parent: parent}, success: function(data) { $("#ingredients").html(data); } }); 

в вашем process.php

 $parent = $_POST['parent']; echo($parent);