SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict Mainer82's Avatar
    Join Date
    Aug 2003
    Location
    Maine, USA
    Posts
    249
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Checkboxes to control a MySQL query

    I have a table with many different fields, essentially it lists a bunch of various products. These products are categorized by some of the fields, for example, movie, book, game. And if it's a game, the field as a Yes of not, a No.

    On the front end, I want to create a form that will give me these options:

    What do you want to see?
    [] Games [] Movies [] Books [] Etc.

    And if I want to just see Games, I'll put a check in, if I want to see multiple items, I'd select them and then select Search.

    Can you point me in the direction I should go with the code? I've read some guides but they are not geared towards what I'm looking to do. Thank you,
    Get to know the man behind the screen

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,501
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by Mainer82 View Post
    I have a table with many different fields, essentially it lists a bunch of various products. These products are categorized by some of the fields, for example, movie, book, game. And if it's a game, the field as a Yes of not, a No.
    And what are you going to do if you need a new category? Add a column to the products table?

  3. #3
    SitePoint Guru bronze trophy TomB's Avatar
    Join Date
    Oct 2005
    Location
    Milton Keynes, UK
    Posts
    989
    Mentioned
    9 Post(s)
    Tagged
    2 Thread(s)
    Take a look at my post here: http://www.sitepoint.com/forums/show...=1#post4156456 I provided a simple solution using bitflags


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •