List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:March 30 2002 4:50pm
Subject:Re: limiting a select
View as plain text  
At 9:50 -0600 3/30/02, Alex Behrens wrote:
>Hey guys,
>quick question, I'm setting up a script that does headlines for my site and
>I need to pull some information from a table with my review info from it but
>I only want to view the 7 latest reviews, how do I make it so I can only
>view like 7 highest values for the "num" column?
>my query is this:
>$r = mysql_query("SELECT * FROM hwureviews LIMIT (MAX(num)-7),7"); Does this
>work or am I way off?

It won't work.  The arguments to LIMIT must be constants.

>-Alex "Big Al" Behrens
>E-mail: bigal@stripped
>Urgent E-mail: bigal-cell@stripped (Please be brief!)
>Phone: 651-482-8779
>Cell: 651-329-4187
>Fax: 651-482-1391
>ICQ: 3969599
>Owner of the 3D-Unlimited Network:
>Send News:
limiting a selectAlex Behrens30 Mar
  • RE: limiting a selectRoger Baklund30 Mar
  • Re: limiting a selectPaul DuBois30 Mar
    • Re: limiting a selectChris Adams30 Mar
      • Re: limiting a selectAlex Behrens30 Mar