Skip to content

Instantly share code, notes, and snippets.

@udibagas
Created April 9, 2013 09:41
Show Gist options
  • Save udibagas/5344425 to your computer and use it in GitHub Desktop.
Save udibagas/5344425 to your computer and use it in GitHub Desktop.
<?php
$con = mysql_connect('localhost', 'root', 'xxx');
$db = mysql_select_db('[nama_db]', $con);
$per_page = 10;
$offset = isset($_GET['offset']) ? $_GET['offset'] : 0;
$query = mysql_query("SELECT * FROM [nama_table] ORDER BY ID ASC LIMIT $offset, $per_page");
while ($data = mysql_fetch_array($query)) {
echo $data['[nama_field]']."<br />";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment