Patch to limit testing results in AppDB
Chris Morgan
cmorgan at alum.wpi.edu
Thu Jan 26 20:36:32 CST 2006
On Thursday 26 January 2006 9:14 pm, Jason Weisberger wrote:
> > 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.
>
Sure.
I'd do this:
$sQuery = "SELECT *
FROM testResults
WHERE versionId = '".$iVersionId."'
ORDER BY testedDate DESC";
/* if we aren't showing all entries we should append a limit to the sql */
if(!$showAll)
$sQuery.=" LIMIT 0,".$max_entries_limit;
$hResult = query_appdb($sQuery);
if(!$hResult) return;
Isn't this the same?
Chris
More information about the wine-patches
mailing list