Skip to content

Instantly share code, notes, and snippets.

@niraj-shah
Created August 12, 2014 12:00
Show Gist options
  • Save niraj-shah/6bf11dc34266b839b452 to your computer and use it in GitHub Desktop.
Save niraj-shah/6bf11dc34266b839b452 to your computer and use it in GitHub Desktop.
Parse Pagination Using Unofficial PHP Parse SDK from: https://github.com/apotropaic/parse.com-php-library
<?php
// using https://github.com/apotropaic/parse.com-php-library PHP Parse Library
require_once( 'Parse/parse.php' );
$query = new parseQuery('TestClass');
// hack to get all results
$query->whereNotEqualTo( 'name', 'foo' );
// pickup offset from URL
if ( isset( $_GET['p'] ) && is_numeric( $_GET['p'] ) ) {
$query->setSkip( $_GET['p'] );
}
// default result limit
$query->setLimit( 10 );
$results = $query->find();
// display results
print_r( $results );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment