Re: [PHP] category and sub category traversal

2008-12-02 Thread Richard Heyes
I need some help in figuring out this logic. I have two tables one for category and other for category_hierarchy. category_hirerarchy has a column to determine the parent. So the query I have to retrieve tree of one specific category is: SELECT t.tid, t.*, parent FROM term_data t INNER

[PHP] category and sub category traversal

2008-12-02 Thread ceo
Google for SELF JOIN You also may want to just put the parent_id in the category table, rather than a second table. Your query would then look like this: select parent.tid, child.tid from term_data as parent, term_data as child where child.parent_id = parent.tid and child.vid = 16

[PHP] category and sub category traversal

2008-12-01 Thread VamVan
Hello, I need some help in figuring out this logic. I have two tables one for category and other for category_hierarchy. category_hirerarchy has a column to determine the parent. So the query I have to retrieve tree of one specific category is: SELECT t.tid, t.*, parent FROM term_data t INNER

Re: [PHP] category and sub category traversal

2008-12-01 Thread Chris
VamVan wrote: Hello, I need some help in figuring out this logic. I have two tables one for category and other for category_hierarchy. category_hirerarchy has a column to determine the parent. So the query I have to retrieve tree of one specific category is: SELECT t.tid, t.*, parent FROM

RE: [PHP] category and sub category traversal

2008-12-01 Thread bruce
hey vamvan... you might pop this to the mysql email list as well, if you haven't already! [EMAIL PROTECTED] -Original Message- From: VamVan [mailto:[EMAIL PROTECTED] Sent: Monday, December 01, 2008 5:13 PM To: php List Subject: [PHP] category and sub category traversal Hello