Skip to main content

Posts

Showing posts with the label pagination

PHP/JSON-jquery pagination

I Need away to show two per page, and have a pagination at the bottom of the page. Here is how I am currently doing it. As you can see we dont do any pagination at the moment. PHP code which returns the JSON data public function realcashoffers($state,$count) { $this->state = $state; $this->number = $count; $result = $this->JSONselect("approved_business, business_stores, Real_Cash_Offers"," *, group_concat(offer ORDER BY offer ASC SEPARATOR ',') as offers"," approved_business.id = business_stores.business_id AND Real_Cash_Offers.business_id = approved_business.id AND Real_Cash_Offers.storeid = business_stores.storeid AND business_stores.state = '{$this->state}'","GROUP BY id ORDER BY RAND(), approved_business.id DESC LIMIT {$this->number} "); $remaining = $count - count($result); if ($remaining) { $this->type = 'G'; $result = array_merge($result, $this->JSONselect("iN