SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Jan 2005
    Location
    md
    Posts
    180
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using LIMIT and WHERE clause

    Is it posible to use a LIMIT with a WHERE clause? This is my code and it works fine, just not with the where..

    PHP Code:
    SELECT FROM products LIMIT $limitvalue$limit WHERE title LIKE '%$q%' 
    Thanks!

  2. #2
    SitePoint Evangelist sysice's Avatar
    Join Date
    Oct 2004
    Location
    Hackettstown, NJ
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Unless I don't understand the question, just reverse the order:

    PHP Code:
     SELECT FROM products WHERE title LIKE '%$q%' LIMIT $limitvalue$limit 

  3. #3
    From downunder but sure 2 rise Hazardous's Avatar
    Join Date
    Aug 2003
    Location
    New Zealand
    Posts
    361
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As far as I know there is no other way
    Hazardous
    My Blog


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
  •