Hi everybody,
Exactly what the title says!  And the funny thing is that if I click on page no.1 I get 10 results, if I click page no.2 I get 20 results, page no.3 30 results and so on... What am I doing wrong?
Here's my code:
PHP Code:
<? if (!(isset($start))) { $start=0; } $maxperpage=10; $tend = $start+$maxperpage;
$ SOME SQL QUERY = (" ... LIMIT $start,$tend") ?>
****HERE I GET THE SQL RESULTS-OUTCOME****
and then towards the end of the page, I have the following code:
<a href=URL&start=0\">1</a>");
PHP Code:
<? $more= mysql_query("SELECT * FROM * WHERE *** ") or die(mysql_error()); $more2= mysql_num_rows($more); $maxpage = ceil($divide/$maxperpage); if (($more2/$maxperpage)>$maxpage) { $maxpage=$maxpage+1; } for ($j=1;$j<$maxpage;$j++){ $cs = ($j*$maxperpage); $cp = $j+1; print(" | <a href=URL&start=$cs>$cp</a>"); } ?>
The outcome of the code above is like this:
Pages: 1, 2, 3, 4, 5 etc.
and every time I click on any number I get the SQL results-records multiplied by 10 (e.g. if I click on 3 I get 30 results per page, on 5 I get 50! etc).
Any help would be GREATLY appreciated!
Last edited by bob25; 03-12-2008 at 10:58 AM..
Reason: php tags - newbie!
|