Breadcrum Modified Pre-order Tree Transversal MPTT SQL Query

RegisterLogin
Breadcrum Modified Pre-order Tree Transversal MPTT SQL Query
Post Description: Breadcrum Modified Pre-order Tree Transversal MPTT SQL Query
Tags: Breadcrum, Modified, Pre-order, Tree, Transversal, MPTT, SQL, Query
This Post Was Posted On Feb 29, 2008 By web hosting #1342
$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.category_id = '12') ORDER BY C.category_left";

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";

Leave Your Comments
Related Pages: [Add Your Website]
Post New Topic
©2011 Webune Forums - Tue Dec 20, 2011 1:40 am
Powered by: Webune Forums V3