MYSQL Query Issue

Discussion in 'MySQL' started by cavendano, Jun 13, 2010.

  1. #1
    I have a query that is not erroring out but it is not giving me the results I am asking for.
    For example if I want to find out what item is less than number 120000 the first query will work but then lets say I want to get more specific it will keep generating the wrong result but no errors.

    First query (works great)
    SELECT * FROM `table` WHERE number<'120000' AND item='amazon' AND title!='' AND artist !='' order by number desc LIMIT 9
    Code (markup):
    Second Query (It retrieves the LIKE but it doesnt filter anything < than 120000):
    SELECT * FROM `table` WHERE number<'120000' AND title LIKE '%black%' or item LIKE '%black%' order by number desc LIMIT 9
    Code (markup):
    If I take off :
    AND title LIKE '%black%' or item LIKE '%black%' 
    Code (markup):
    the query will do what I want so I am wondering how I can get it to work?
     
    cavendano, Jun 13, 2010 IP
  2. cavendano

    cavendano Well-Known Member

    Messages:
    360
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    130
    #2
    got it thanks...
    just had to use some pagination...
     
    cavendano, Jun 13, 2010 IP