dropfaith Posted October 12, 2008 Share Posted October 12, 2008 what would the best way to set this up be im thinking two tables one for the name of what your making, about, cook time, all that then a second for ingredients with just an Id and the Ingredient name but the issue im imagining is being able to insert multiple rows into ingredients in one query? Quote Link to comment https://forums.phpfreaks.com/topic/128068-recipes-database/ Share on other sites More sharing options...
keeB Posted October 12, 2008 Share Posted October 12, 2008 I made a recipe database for myself, this is what mine looks like... create table food_category ( category_id int not null primary key, name text not null ) go create table food_recipe ( recipe_id int not null primary key, name text not null, category_id int not null REFERENCES food_category (category_id) ) go create table food_ingredient ( ingredient_id int not null primary key, ingredient_name text not null ) go create table food_quantity_type ( quantity_type_id int not null, quantity_name text not null ) go create table food_recipe_ingredient ( recipe_id int not null REFERENCES food_recipe(recipe_id), ingredient_id int not null REFERENCES food_ingredient(ingredient_id), quantity int not null, quantity_type_id int not null REFERENCES food_quantity_type(quantity_type_id) ) go create table food_recipe_tags ( recipe_id int not null REFERENCES food_recipe(recipe_id), tag text not null ) Quote Link to comment https://forums.phpfreaks.com/topic/128068-recipes-database/#findComment-663450 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.