Welcome Guest, Not a member yet? Register   Sign In
subcategory solution
#5

[eluser]Tominator[/eluser]
Yes, it means Smile I think it will be "fail" Big Grin

I am using this model (DB):

| category |
-----------------------------
| ID | name | parent | etc (like date, who added ...)
| 1 | First | 0 | ...
| 2 | Second | 0 | ...
| 3 | Third | 2 | ...
| 4 | Fourth | 3 | ...
| 5 | NewOne | 4 | ...
| 6 | LastOne | 4 | ...
-------------------------------

##############################################

| product |
----------------------------
| ID | category | name | etc. (value, count, seo-name ...)
| 1 | 1 | First | ...
| 2 | 2|3|4|5 | Second | ...
| 2 | 2|3|4|6 | Third | ...
| 2 | 2|3|4|6 | LastOne| ...

##########################################

Your menu will be then:

- First (+ First product)
- Second
- Third
- Fourth
- NewOne (+ Second product)
- LastOne (+ Third and LastOne product)


Why this model?

When you want to show all products in some category you use:

Second category:
SELECT * FROM product WHERE category LIKE '2%'

Third category:
SELECT * FROM product WHERE category LIKE '2|3%'

etc.


Messages In This Thread
subcategory solution - by El Forum - 04-17-2010, 05:12 AM
subcategory solution - by El Forum - 04-17-2010, 07:50 AM
subcategory solution - by El Forum - 04-17-2010, 11:48 AM
subcategory solution - by El Forum - 04-17-2010, 12:04 PM
subcategory solution - by El Forum - 04-17-2010, 12:53 PM
subcategory solution - by El Forum - 04-17-2010, 01:34 PM
subcategory solution - by El Forum - 04-17-2010, 01:39 PM
subcategory solution - by El Forum - 04-17-2010, 01:42 PM
subcategory solution - by El Forum - 04-17-2010, 01:53 PM
subcategory solution - by El Forum - 04-17-2010, 02:55 PM
subcategory solution - by El Forum - 04-17-2010, 05:26 PM



Theme © iAndrew 2016 - Forum software by © MyBB