Login   Register  
PHP Classes
elePHPant
Icontem

File: class_rs.txt

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Alexandru Aliu  >  MySQL Pagination  >  class_rs.txt  >  Download  
File: class_rs.txt
Role: Documentation
Content type: text/plain
Description: Short user manual for this class
Class: MySQL Pagination
Retrieve and display MySQL query split in pages
Author: By
Last change:
Date: 7 years ago
Size: 1,062 bytes
 

Contents

Class file image Download
<?php
class recordset

var $_connection=""; //this will set/get current database connection
var $_sql_string=""; //we send the sql string without limits and without "; "

var $_url = ""; //it's mandatory to send url with the rest of QUERY_STRING parameters; if there aren't other parameters you send this with ?. Ex: $myobj->_url = "mypage.php?"
var $_p_name = "page"; //if you don't send this, the default is page

var $_records_page = 25; //this will get/set the number of records on a page
var $_page = 1; // this will help you to set the current page

function get_no_pages()
// you use this for getting the total number of pages based on $_records_page and row count from mysql result

function get_str_pages()
// Gives you the string for navigation on pages
// 1 2 3 ... etc ...

function get_arr_rst($Paged=true)
/*
This is the method which gives you an array with your sql result
Is a key based array so you can acces it by the name of field alias $R[12]["id"] will return the value of ID for the 12 record in yoour result
*/
?>