Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include'IngredientCodes.php';
- include'connect.php';
- $ingredient_array = array();
- // check if any of the checkboxes were checked
- if(isset($_POST['check_list'])){
- // add each value from HTML check_list array to PHP ingredien_array.
- foreach($_POST['check_list'] as $value){
- array_push($ingredient_array, $value);
- }
- }
- $recipe_query = "SELECT RecipeURL, Count(1) as 'Likeness'
- FROM Recipes R, (SELECT * FROM Ingredients WHERE IngredientCode in (0,1)) I #List of selected Ingredients
- WHERE R.RecipeID = I.RecipeID AND R.RecipeID NOT IN (SELECT RecipeID FROM Ingredients WHERE IngredientCode in (1)) #Exclusion list
- GROUP BY RecipeURL
- ORDER BY Likeness desc";
- $result = mysqli_query($conn, $recipe_query);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement