[eluser]Twisted1919[/eluser]
I just did, i posted my function above , an example of produced result is this :
Code:
0.0003 SELECT category_id,name,image,url FROM categories WHERE parent_id IS NULL ORDER BY sort_order ASC
0.0002 SELECT category_id,name FROM categories WHERE parent_id IS NULL AND sort_order > -1 ORDER BY sort_order ASC
0.0001 SELECT category_id,name FROM categories WHERE parent_id = '8' AND sort_order > -1 ORDER BY sort_order ASC
0.0001 SELECT category_id,name FROM categories WHERE parent_id = '10' AND sort_order > -1 ORDER BY sort_order ASC
0.0001 SELECT category_id,name FROM categories WHERE parent_id = '11' AND sort_order > -1 ORDER BY sort_order ASC
0.0001 SELECT category_id,name FROM categories WHERE parent_id = '12' AND sort_order > -1 ORDER BY sort_order ASC
0.0001 SELECT category_id,name FROM categories WHERE parent_id = '13' AND sort_order > -1 ORDER BY sort_order ASC
0.0001 SELECT category_id,name FROM categories WHERE parent_id = '14' AND sort_order > -1 ORDER BY sort_order ASC
0.0001 SELECT category_id,name FROM categories WHERE parent_id = '15' AND sort_order > -1 ORDER BY sort_order ASC
0.0001 SELECT category_id,name FROM categories WHERE parent_id = '16' AND sort_order > -1 ORDER BY sort_order ASC
0.0001 SELECT category_id,name FROM categories WHERE parent_id = '17' AND sort_order > -1 ORDER BY sort_order ASC
0.0001 SELECT category_id,name FROM categories WHERE parent_id = '18' AND sort_order > -1 ORDER BY sort_order ASC
0.0001 SELECT category_id,name FROM categories WHERE parent_id = '19' AND sort_order > -1 ORDER BY sort_order ASC
0.0001 SELECT category_id,name FROM categories WHERE parent_id = '20' AND sort_order > -1 ORDER BY sort_order ASC
0.0001 SELECT category_id,name FROM categories WHERE parent_id = '21' AND sort_order > -1 ORDER BY sort_order ASC
0.0001 SELECT category_id,name FROM categories WHERE parent_id = '22' AND sort_order > -1 ORDER BY sort_order ASC
0.0001 SELECT category_id,name FROM categories WHERE parent_id = '23' AND sort_order > -1 ORDER BY sort_order ASC
0.0001 SELECT category_id,name FROM categories WHERE parent_id = '24' AND sort_order > -1 ORDER BY sort_order ASC
0.0001 SELECT category_id,name FROM categories WHERE parent_id = '25' AND sort_order > -1 ORDER BY sort_order ASC
0.0001 SELECT category_id,name FROM categories WHERE parent_id = '26' AND sort_order > -1 ORDER BY sort_order ASC
Maybe i didn't understand the question ?