SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2001
    Location
    Dallas, TX
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error on Query Statement...

    PHP Code:
    SELECT rank FROM ".$ladder." ORDER BY rank DESC Limit 11 WHERE rank!=0
    that is giving me the following error:
    You have an error in your SQL syntax near 'WHERE rank!=0' at line 1

    why?

  2. #2
    Happy Holidays !! Paul S's Avatar
    Join Date
    Mar 2001
    Location
    Mexico
    Posts
    1,287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just change the order,

    $q = "SELECT rank FROM $ladder WHERE rank!=0 ORDER BY rank DESC LIMIT 1,1";

    From MySQL Manual: All keywords used must be given in exactly the order shown above.


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
  •