SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2006
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    writing query that include 3 conditions

    hi,i wish to extract data that fulfill a category id,sub category id and keyword...

    i tried on the below query...but it is not working..

    can i know the correct way to write the query please?

    PHP Code:
    select from post where categoryID=$idsubcategory=$sid AND keyword like '$keyword' 

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,347
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    Code:
    select please
         , list
         , the
         , columns
         , you
         , need
      from post
     where categoryid = $id
       and subcategory = $sid
       and keyword like '$keyword'
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Addict
    Join Date
    Sep 2005
    Posts
    335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    select * from post where categoryID=$id AND subcategory=$sid AND keyword like '%$keyword%'
    PHP Shopping Cart Software Easy Ecommerce Shopping Cart Script.
    PHP Super Cart is 100% template driven.


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
  •