iversonm Posted August 14, 2008 Share Posted August 14, 2008 lets say i have a table called, vegies it the table vegies have multiple lines each with the row name called= corn, potatoes, beans, carrots, pea, and turnips now lets say i want to pull from the database but for each row there is also another table called corn, potatoes, beans, carrots, pea, and turnips this is what i dont know how to do if i want to take the results from the table vegies and then take it and pull from the table that corrispons to the row so like in the row corn it would pull info from the table corn im sorry if this doesnt make sense let me know Quote Link to comment Share on other sites More sharing options...
toplay Posted August 14, 2008 Share Posted August 14, 2008 You would have to first read from the vegies table, then use that value to form the second query and run that separately (the value retrieved from the vegie table will be the table name value for the second query). This approach is very limiting. You should not organize your data in that way - a table for each type of veggie. Ideally you would have all vegies in one table and you could have another column to designate further what it is (starch food, yellow food, green food, etc.). Learn about database normalization: http://www.google.com/search?hl=en&q=database+normalization Quote Link to comment Share on other sites More sharing options...
fenway Posted August 14, 2008 Share Posted August 14, 2008 There are some excellent stickies on this topic. Quote Link to comment 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.