SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Quick Help

Hybrid View

  1. #1
    Free me php klassicd's Avatar
    Join Date
    Sep 2001
    Location
    San Diego
    Posts
    509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Quick Help

    PHP Code:
    $sql mysql_query("SELECT * FROM scripts WHERE sec_id='1' ORDER BY downloads LIMIT 1,10 ASC"); 
    It looks dandy to me. But i recieve this error from mysql_error.

    Error: You have an error in your SQL syntax near 'ASC' at line 1

    Any help would be appreciated.

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ASC goes before the LIMIT just after the downloads.

    PHP Code:
    $sql mysql_query("SELECT * FROM scripts WHERE sec_id='1' ORDER BY downloads ASC LIMIT 1,10"); 
    Actually the ASC is by default, so you can just do

    PHP Code:
    $sql mysql_query("SELECT * FROM scripts WHERE sec_id='1' ORDER BY downloads LIMIT 1,10"); 
    Please don't PM me with questions.
    Use the forums, that is what they are here for.


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
  •