Jump to content

any way to get forum path with single SQL query?


rain13

Recommended Posts

Hellosuppose I have following table 'forums'forumId, parentId, Name1, 0, chat2, 1, pets3, 1, biking4, 2, catsMeaning that pets is subforum of chat and cats is sub forum of pets.To get In PHP I would call GetParent() until parentId gets 0. which would run mysql_query() 3 times to get path for cats.The path would be chat => pets => catsI was wondering if it is possible to write single SQL query to get such path?

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...