how to manage products with different flags??

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
PHPycho
Forum Contributor
Posts: 336
Joined: Fri Jan 06, 2006 12:37 pm

how to manage products with different flags??

Post by PHPycho »

How do you handle product with different flags like featured, new, christmas special, valentine special..?

do you use fields in the same product table (sayroducts)
or different table
But How?
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: how to manage products with different flags??

Post by Benjamin »

You can use the "Entity Attribute Value" database model. Essentially you would create a separate table which stores the product id, attribute name and the attribute value.

http://en.wikipedia.org/wiki/Entity-att ... alue_model
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Re: how to manage products with different flags??

Post by Luke »

Dude, I don't mean to be rude, but I don't think I've ever seen a question that makes less sense than this. I think I can speak for the entire PHP developer's network when I say...

WHAT?? :? :? :?
User avatar
PHPycho
Forum Contributor
Posts: 336
Joined: Fri Jan 06, 2006 12:37 pm

Re: how to manage products with different flags??

Post by PHPycho »

@Luke: Can you elaborate??
Why my question doesn't make much sense???
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: how to manage products with different flags??

Post by VladSun »

I am not a fan of EAV, so I'd suggest using either a bitmask field into the table itself, or using two additional tables - flag and product_has_many_flags table.
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply