phpcodec Posted May 26, 2008 Share Posted May 26, 2008 function pagination($current_page,$total_rows) { $current_page = (!is_numeric($current_page))?'1':$current_page; $results_per_page = '24'; echo '<b>Select A Page:</b><br />'; if($total_rows=='0') { echo 'No Pages Available'; $start = '0'; $finish = '0'; } else { $total_pages = ceil($total_rows/$results_per_page); if($current_page>'1') { echo '<a href="?page='.($current_page-1).'"><<Previous</a> '; } for($i='1';$i<=$total_pages;$i++) { if($current_page==$i) { echo '<a href="?page='.$i.'"><b>['.$i.']</b></a> '; } else { echo '<a href="?page='.$i.'">'.$i.'</a> '; } } if($current_page<$total_pages) { echo '<a href="?page='.($page+1).'">Next>></a> '; } $start = $current_page*$results_per_page-$results_per_page; $finish = $results_per_page; } } pagination($_GET['page'],$row); echo $start.' '.$finish; When i echo $start and $finish after i call the function pagination() it does'nt show anything, how can make this work? Link to comment Share on other sites More sharing options...
ILYAS415 Posted May 26, 2008 Share Posted May 26, 2008 put echo "$start $finish"; in your function not outside it and tell me results plz. Link to comment Share on other sites More sharing options...
Recommended Posts