Skip to content

Instantly share code, notes, and snippets.

@jordanandree
Created December 27, 2010 23:26
Show Gist options
  • Save jordanandree/756699 to your computer and use it in GitHub Desktop.
Save jordanandree/756699 to your computer and use it in GitHub Desktop.
<?php
$start = $_GET['page'] == 1 || $_GET['page'] == '' ? 0 : $_GET['page'] * $perpage;
$perpage = 10;
$query = "SELECT * FROM table LIMIT $start, $perpage";
$query = mysql_query($query);
while($row = mysql_fetch_array($query)):
echo '<p>'.$row['id'].' '.$row['data'].'</p>';
endwhile;
echo paginate( mysql_num_rows(mysql_query("SELECT * FROM data")), $perpage );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment