i created this query because i wanted to know how i can get the breadcrum out of a Modified Pre-order Tree Transversal menu as shown here:
http://www.wallpaperama.com/forums/mptt-modified-pre-order-tree-transversal-php-tree-menu-script-t5713.html
so in keeping with this example. i want to show all the links for the bread yellow so it would look like this:
Food
Fruit
Yellow
as you can see, Yellow has a value of 5 in id colum so i can use this query to get all its perents:
$sql = "SELECT C.* from myp1_category AS B, myp1_category AS C WHERE (B.category_left BETWEEN C.category_left AND C.category_right) AND (B.id = '5') ORDER BY C.category_left";