Classifieds System
Moderator: General Moderators
Classifieds System
Hello,
I'm working on a Classifieds but i don't know how this work like i have this main cats with subcats=
Computer => Hardware, Software
People => Jobs, Services
Synths => Samplers, Vintages
How can i fix something like this with cats, subcats and how to fix this in the database like tables i need.
I need on my mainpage something like this => http://www.macmusic.org/ads/?lang=EN
Cheers
Kris
I'm working on a Classifieds but i don't know how this work like i have this main cats with subcats=
Computer => Hardware, Software
People => Jobs, Services
Synths => Samplers, Vintages
How can i fix something like this with cats, subcats and how to fix this in the database like tables i need.
I need on my mainpage something like this => http://www.macmusic.org/ads/?lang=EN
Cheers
Kris
-
Stoneguard
- Forum Contributor
- Posts: 101
- Joined: Wed Aug 13, 2003 9:02 pm
- Location: USA
Well Mr Rincewind (sorry, your user name reminds me of a book),
I would think you must think about how to designate a record as a category or a sub-category, and what it's parent category is. Then you would write a routine to pull categories and add their children records under them.
That should get you started. My understanding for this site is the intent is for you to present a solution that you need help with, not ask for a solution (isn't that what we get paid for? providing solutions?)
I would think you must think about how to designate a record as a category or a sub-category, and what it's parent category is. Then you would write a routine to pull categories and add their children records under them.
That should get you started. My understanding for this site is the intent is for you to present a solution that you need help with, not ask for a solution (isn't that what we get paid for? providing solutions?)
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
-
Stoneguard
- Forum Contributor
- Posts: 101
- Joined: Wed Aug 13, 2003 9:02 pm
- Location: USA
For specific categories and subcategories in a database I usually use 2 ENUM columns. One for all possible categories and one for all possible subcategories.
As far as I can see you'd want an ENUM column named Category with: Computer, People, Synths as the choices. Then have Hardware, Software, Jobs, Services, Samplers, Vintages as another ENUM column named Subcategory.
As far as I can see you'd want an ENUM column named Category with: Computer, People, Synths as the choices. Then have Hardware, Software, Jobs, Services, Samplers, Vintages as another ENUM column named Subcategory.
-
Stoneguard
- Forum Contributor
- Posts: 101
- Joined: Wed Aug 13, 2003 9:02 pm
- Location: USA
dear my friend
as my friend says you can use enum type to indicate that that column is showing whether that index is a categiry or subcategory
you will searc the upper catgorys as
select * from my_table where enum_column=1;
this will return the column indexes where they are marked as 1
then u can start to search the sub categories
and also you can give indexes to upper categories in an other int column so u can organize the sub ones as this
select * from my_table where uppercategor_enum_column = 3;
for ex 3 indicates computers
i wish i could help to you
you will searc the upper catgorys as
select * from my_table where enum_column=1;
this will return the column indexes where they are marked as 1
then u can start to search the sub categories
and also you can give indexes to upper categories in an other int column so u can organize the sub ones as this
select * from my_table where uppercategor_enum_column = 3;
for ex 3 indicates computers
i wish i could help to you