type like enum mysql

Posted on 2012-09-20
Last Modified: 2012-09-21
Type like enum but it can select more than one       such as t-shirt can be in man garment and women garment  if it not have type like that how can we do when somethings can classified in many category
Question by:teera
    1 Comment
    LVL 24

    Accepted Solution

    What you need is not enum but a many-to-many relationship.  Basically have a table for your products, another for your categories, then a product_category "link" table.  Then you use SQL joins to find out which categories a product belongs to and/or which products are under a chosen category.

    There are many tutorials on the web regarding the many-to-many relationship.  Here's a few:

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL ( several years ago, it seemed like now was a good time to updat…
    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now