<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>&nbsp;&nbsp;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">
&nbsp; sql with a limit</blockquote><div><br>That's exactly the idea.&nbsp; Correct me if I'm wrong, but I didn't think I could tone it down any more than that.&nbsp; 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.&nbsp; That's only 2 of them for the whole function.&nbsp; We can't test for the conditionals without that first query and we can't run the appropriate one without the second.&nbsp; As usual correct me if I'm wrong.&nbsp; I'm sort of using this as a learning experience :)&nbsp; 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> &lt;<a href="mailto:cmorgan@alum.wpi.edu">cmorgan@alum.wpi.edu</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&gt; Ok, I implemented some of your ideas except for your idea with the Query.<br>&gt; I'm not sure how you would have wanted to do that one.&nbsp;&nbsp;I figured we'd need<br>&gt; one Query to get our initial row count, then one for each conditional to
<br>&gt; set for pulling the data again with limited results.&nbsp;&nbsp;Using your sQuery<br>&gt; variable inside those conditionals would yield the same amount of queries.<br>&gt;<br><br>Maybe I wasn't clear about your code.&nbsp;&nbsp;I thought the goal was something like:
<br><br>if(showingAll or less than X items)<br>&nbsp;&nbsp;sql without a limit<br>else<br>&nbsp;&nbsp;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?&nbsp;&nbsp;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>