I have a mysql question.
I have an application which I am migrating to PHP/Mysql from Coldfusion and MSSql.
There are categories and sub-categories (with apparently unlimited sub-categories).
What is the best way to grab all of the records in a products table given a navigationID.
there are two tables I am dealing with. One is the Products table (which has a nav_id corresponding to --->) and the other is a category relationship table which includes parent/child relationships.
So essentially I want to query the two tables to produce all of the products associated with a navigationID and that NavigationID's sub categories.
any ideas or directions? I know this has to be done. Was thinking the answer would lie in a nested query but cannot wrap my head around it.
Nav_table - contains
ChildNavId int(11)
ParentNavId int(11)
Products_Table - contains
productNavID int(11) // productNavID contains the lowest level NavID