SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2000
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello Everyone,

    I am creating a "Where" statement in order to limit the display of certain records. Basically, one entry can be listed in three categories. I need a particular file to display an entry if it appears in a category...However, the way I have it, an entry has to have Clothing & Accessories as Category 1, inorder to be displayed...How can I change the statement to reflect the possibility that an entry can be under either category1, category 2, or category 3?



    Where Category_1 = 'Clothing & Accessories' or Category_2 = 'Clothing & Accessories' or Category_3 = 'Clothing & Accessories'

  2. #2
    SitePoint Addict
    Join Date
    Dec 2000
    Location
    BOSTON MA
    Posts
    335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how 'bout something like this? :


    SELECT * as some_variable FROM $table WHERE Category_1 = 'Clothing & Accessories' OR Category_2 = 'Clothing & Accessories' OR Category_3 = 'Clothing & Accessories' ;
    check this page out if you care to learn more : http://www.w3scripts.com/sql/sql_and_or.asp
    . . . chris


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
  •