Patch to limit testing results in AppDB

Jason Weisberger jbdubbs at
Thu Jan 26 20:14:38 CST 2006

> if(showingAll or less than X items)
>   sql without a limit
> else
  sql with a limit

That's exactly the idea.  Correct me if I'm wrong, but I didn't think I
could tone it down any more than that.  We'd need one query to get the
number of results in the first place and to have the conditionals run on it,
then we'd need to adjust $hResult to run the appropriate query for the rest
of the function.  That's only 2 of them for the whole function.  We can't
test for the conditionals without that first query and we can't run the
appropriate one without the second.  As usual correct me if I'm wrong.  I'm
sort of using this as a learning experience :)  Perhaps if I'm too thick
headed, feel free to show me what you mean in the patch itself.

On 1/27/06, Chris Morgan <cmorgan at> wrote:
> > Ok, I implemented some of your ideas except for your idea with the
> Query.
> > I'm not sure how you would have wanted to do that one.  I figured we'd
> need
> > one Query to get our initial row count, then one for each conditional to
> > set for pulling the data again with limited results.  Using your sQuery
> > variable inside those conditionals would yield the same amount of
> queries.
> >
> Maybe I wasn't clear about your code.  I thought the goal was something
> like:
> if(showingAll or less than X items)
>   sql without a limit
> else
>   sql with a limit
> Why not just skip the query to get the number of items and just put the
> limit
> in?  If the number is less than the limit then you'll see all of the
> results,
> if it is more then you'll get the first X results.
> The other change looks good though.
> Chris

Jason Weisberger
jbdubbs at
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the wine-patches mailing list