Help me in this work.

Discussion in 'PHP' started by balasun, Aug 16, 2008.

  1. #1
    Hello all,

    I want to made the search operation using mysql query.

    The fileld name ''proddesc" which is a blob type filed which contains following data like

    "the elegantly designed LC420SS8 42" Wide HDTV LCD TV with Full HD 1080p provides the ultimate home entertainment experience with stunning picture quality. Fully loaded with a vast array of features, including HDTV compatibility, the special, limited edition LC420SS8 also provides convenient Sound Control options."

    When i typed 'LC420SS8 42" Wide HDTV LCD TV' as a keyword for search. The result is not displayed.

    There are more than five filelds i checked for , the query for the above keyword is

    SELECT * FROM page_content WHERE (modelno LIKE '%lc420ss8 42" wide hdtv lcd tv %') or (modelno LIKE '%LC420SS8 42" WIDE HDTV LCD TV %') or (prodname LIKE '%lc420ss8 42" wide hdtv lcd tv %') or (prodname LIKE '%LC420SS8 42" WIDE HDTV LCD TV %') or (proddesc LIKE '%lc420ss8 42" wide hdtv lcd tv %') or (proddesc LIKE '%LC420SS8 42" WIDE HDTV LCD TV %') or (prodfeature LIKE '%lc420ss8 42" wide hdtv lcd tv %') or (prodfeature LIKE '%LC420SS8 42" WIDE HDTV LCD TV %') or (prodspec LIKE '%lc420ss8 42" wide hdtv lcd tv %') or (prodspec LIKE '%LC420SS8 42" WIDE HDTV LCD TV %')
    PHP:
    Is any problem in my query. Please Help me if u know the answer.
     
    balasun, Aug 16, 2008 IP
  2. rob_v

    rob_v Peon

    Messages:
    72
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    depending on the DB you are using - the like most likely is case sensitive.
    try doing something like where lower(proddesc) like '%lc420ss8 42" wide hdtv lcd tv%' ......

    BTW that qry is going to kill your database.
     
    rob_v, Aug 16, 2008 IP
  3. webboy

    webboy Peon

    Messages:
    109
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3

    Have you tried %lc420ss8% in the SELECT
     
    webboy, Aug 20, 2008 IP