¡@

Home 

php Programming Glossary: rght

Getting a modified preorder tree traversal model (nested set) into a <ul>

http://stackoverflow.com/questions/1310649/getting-a-modified-preorder-tree-traversal-model-nested-set-into-a-ul

getCats retrieve all children of parent query SELECT max rght as max from t_categories row C_DB fetchSingleRow query max row.. result ul query SELECT from t_categories where lft 0 and rght max if rs C_DB fetchRecordset query p_right p_left p_diff while.. p_right p_left p_diff while row C_DB fetchRow rs diff row rght row lft if diff p_diff result. li . row 'title' . li elseif..

MySQL recursive tree search

http://stackoverflow.com/questions/5725914/mysql-recursive-tree-search

as it makes some queries easier. id name parent lft rght 1 tom 0 1 6 2 bob 0 7 18 3 fred 1 2 5 4 tim 2 8 17 5 leo 4.. 5 13 14 To search j from user bob you'd use the lft and rght values for bob SELECT FROM table WHERE name LIKE 'j ' AND lft.. bob SELECT FROM table WHERE name LIKE 'j ' AND lft 7 AND rght 18 Implementing the logic to update lft and rght for adding..