03-15-2007, 02:11 PM
JackoliciousLegs Wrote:Nobody could get it eh? Well, here are the two solutions I have:
With ternary
$cur_pagesize = ($cur_page * $pagesize > $total_results) ? ($total_results % $pagesize) : $pagesize;
Without
$cur_pagesize = ($pagesize + (floor($cur_page / ceil($total_results / $pagesize))) * (($total_results % pagesize) - $pagesize));
floor and ceil are FUNCTIONS, you didn't say you had access to FUNCTIONS!!! God that's slower than the ternary
