SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist Tapan's Avatar
    Join Date
    May 2005
    Location
    India
    Posts
    563
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Simple query not working

    Hi,

    I have a simple query like this and its not returning the results:

    Code:
    SELECT * FROM products WHERE ItemName LIKE '%rover%' AND ItemName LIKE '%Brake%Pads%' ORDER BY devbg_products.ItemName LIMIT 0, 16
    Can anyone please help me ?

    Thanks.

  2. #2
    SitePoint Guru
    Join Date
    Jan 2004
    Location
    Uppsala, sverige
    Posts
    697
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    You are referring to a table named devbg_products in your order by clause which is not present in the from clause.

  3. #3
    SitePoint Evangelist Tapan's Avatar
    Join Date
    May 2005
    Location
    India
    Posts
    563
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Yes sorry that was a typo, but i figured out how to do it. So now i am doing like this:

    Code:
    SELECT * FROM products WHERE ItemName LIKE '%rover%Brake%Pads%' ORDER BY ItemName LIMIT 0, 16
    And it seems to be working fine.

    Thanks.


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
  •