<blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">if(showingAll or less than X items)<br> sql without a limit<br>else <br></blockquote><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">
sql with a limit</blockquote><div><br>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.
<br></div><br><br><div><span class="gmail_quote">On 1/27/06, <b class="gmail_sendername">Chris Morgan</b> <<a href="mailto:cmorgan@alum.wpi.edu">cmorgan@alum.wpi.edu</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> Ok, I implemented some of your ideas except for your idea with the Query.<br>> I'm not sure how you would have wanted to do that one. I figured we'd need<br>> one Query to get our initial row count, then one for each conditional to
<br>> set for pulling the data again with limited results. Using your sQuery<br>> variable inside those conditionals would yield the same amount of queries.<br>><br><br>Maybe I wasn't clear about your code. I thought the goal was something like:
<br><br>if(showingAll or less than X items)<br> sql without a limit<br>else<br> sql with a limit<br><br>Why not just skip the query to get the number of items and just put the limit<br>in? If the number is less than the limit then you'll see all of the results,
<br>if it is more then you'll get the first X results.<br><br>The other change looks good though.<br><br>Chris<br></blockquote></div><br><br clear="all"><br>-- <br>Jason Weisberger<br><a href="mailto:jbdubbs@gmail.com">jbdubbs@gmail.com
</a>