Problem with LIMIT and ORDER ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • StinkFinger

    Problem with LIMIT and ORDER ?

    this works fine:
    $result = sql_query("SELE CT recent,url,name FROM web_session WHERE
    username='$ip' AND recent !='' ORDER BY time DESC", $dbi);

    this works fine:
    $result = sql_query("SELE CT recent,url,name FROM web_session WHERE
    username='$ip' AND recent !='' LIMIT 5", $dbi);

    however, this returns nothing at all:
    $result = sql_query("SELE CT recent,url,name FROM web_session WHERE
    username='$ip' AND recent !='' ORDER BY time DESC LIMIT 5", $dbi);


  • Geoff Berrow

    #2
    Re: Problem with LIMIT and ORDER ?

    I noticed that Message-ID: <105da52l4prm7b f@corp.supernew s.com> from
    StinkFinger contained the following:
    [color=blue]
    >however, this returns nothing at all:
    >$result = sql_query("SELE CT recent,url,name FROM web_session WHERE
    >username='$i p' AND recent !='' ORDER BY time DESC LIMIT 5", $dbi);[/color]

    ICBW but the first thing I'd try is adding time to the SELECT.
    --
    Geoff Berrow (put thecat out to email)
    It's only Usenet, no one dies.
    My opinions, not the committee's, mine.
    Simple RFDs http://www.ckdog.co.uk/rfdmaker/

    Comment

    Working...