Why doesnt this work?

Discussion in 'MySQL' started by misterdh, Sep 8, 2010.

  1. #1
    Hi !

    I am trying this code:
       $query = "SELECT * FROM `table` WHERE name LIKE '%$keyword%' AND blocked != '%no%' ORDER BY hits DESC LIMIT 10 ";
    PHP:
    The 'blocked' row has the following value: "se dk no uk es"

    Now, what I want it to do is to NOT include that row IF it finds "no" in the blocked row... The problem is that it dont block it :/ It works if I dont use wildcard characters and the 'blocked' row = 'no' but I want to have multiple values in that row...


    Thanks in advance :)
     
    misterdh, Sep 8, 2010 IP
  2. misterdh

    misterdh Peon

    Messages:
    90
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Solved it with

    AND blocked NOT LIKE '%no%'
    PHP:
    Thanks ;)
     
    misterdh, Sep 8, 2010 IP