bobtutos Posted June 3, 2013 Share Posted June 3, 2013 Hello everybody, I do need your help on how to create the database(PHP/MYSQL)with categories and subcategories and which sql command(query) is relevant under this situation?. I tried goggling with no success, so please help me out. Your help is much appreciated. Thanks in advance, Link to comment Share on other sites More sharing options...
justsomeguy Posted June 3, 2013 Share Posted June 3, 2013 You're talking about a tree structure. The easiest way is a table for categories that has a field to hold the ID of the parent category, although there are other database designs that are more efficient for searching, for example pulling out an entire branch with one query. With the other structure you would need to use recursion to print an entire branch. http://www.google.com/search?client=opera&q=efficient+database+design+for+a+tree+structure&sourceid=opera&ie=utf-8&oe=utf-8&channel=suggest 1 Link to comment Share on other sites More sharing options...
bobtutos Posted June 3, 2013 Author Share Posted June 3, 2013 (edited) Thanks 4 the hints and I will try it out. Edited June 3, 2013 by bobtutos Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now