snk Posted March 13, 2008 Share Posted March 13, 2008 hello to all, First of all Im sorry for bothering you with so big message. Iam trying to build a mini cms and i have 5 tables, DB design is fine for my opinon, plz correct if you realise something wrong. From past experience I have Joined multiple table via php values, i was quering a table i was puting the key of the linked table to a value and then i was quering again and again and again. I think is time to move on to a better level. So Im explaining you the design and hopefuly somebody can give me the right query, coz I have spent more than a day trying JOINS and UNIONS I have 5 tables: Tips, Text, Page, Category, Links Page and Links belong to a category, thus I have put the category_key in Page and Links Tips and Text belong to Page, thus I have put the page_key in Tips and Text Now, instead of querying 25.ooo times the database, I would like to get back a table with All of the fields according a value that is coming with GET and represents the page_key. a row flow is coming like $page = $_GET ; $query_return = SELECT page.title, text.text, links.text, links.page_key, tips.text and of course later I echo the values of the return query in the right positions, I know how to do it, plz dont bother to explain Just, to help you to help me, I mention again that Page table is linked with Links table via Category table Thank you in advance Spiros. Quote Link to comment Share on other sites More sharing options...
revraz Posted March 13, 2008 Share Posted March 13, 2008 As long as you have foreign key linking each table to each other, then just do a JOIN ON. Quote Link to comment Share on other sites More sharing options...
snk Posted March 13, 2008 Author Share Posted March 13, 2008 thank you revraz, I will try now and i let you know my progress. I will post the solution in order to might help somebody else 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.