Ive never had to use a query like this before but there must be away to do it without using 2 queries?
Table : forum_categories
--------------------------------------
-- id ---- parent_id ---- name -------
--------------------------------------
1 0 namehere1
2 1 namehere2
3 0 namehere3
4 1 namehere4
5 3 namehere5
I have the id for a sub cat and i want to select the row for the subcat then with the same query select the the row for the parent where parent_id = id for the parent row etc.
Whats the best way to do this?
You want something like
To restrict to your known id, add