Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of jasx  >  DB Layer  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example of dblayer class
Class: DB Layer
Database abstraction layer with pagination support
Author: By
Last change: more example
Date: 10 years ago
Size: 1,552 bytes
 

Contents

Class file image Download
<?php
//Example 1 : simple operation with mysql
//include('mylayer.class.php');
//$dblayer = new mylayer;
//$dblayer -> params("host","user","pass","db");
//$dblayer -> connect();
//$dblayer -> query_exec("select * from table");
//while ( $valore = $dblayer -> rs_array()){

//echo $valore['name_field']."<br>";

//}

//Example 1 bis : simple operation with postgres
//include('pglayer.class.php');
//$dblayer = new pglayer;
//$dblayer -> params("host","user","pass","db");
//$dblayer -> connect();
//$dblayer -> query_exec("select * from table");
//while ( $valore = $dblayer -> rs_array()){

//echo $valore['name_field']."<br>";

//}


 /*
//Example 2: query with pagination
//include('mylayer.class.php');
//$dblayer = new mylayer;
//$dblayer -> params("host","user","pass","db");
//$dblayer -> connect();
//$dblayer -> query_exec_pg("select * from table");
//while ( $valore = $dblayer -> rs_array()){

//echo $valore['name_field']."<br>";

//}

//echo $dblayer -> current_page();  //number of current page
//echo $dblayer -> number_page();  //total pages
//echo $dblayer -> qstring("var=34&prv=56");
//echo $dblayer -> next_page("next"); //href per navigare tra i risultati
//echo $dblayer -> previous_page("pre");  //href per navigare tra i risultati
//echo $dblayer -> all_page();  //all page number

other features
//echo $dblayer -> next_page("<img src=\"freebsd.gif\" border=\"0\">");  //utilizzare un immagine invece del collegamento testuale
//echo $dblayer -> num_rows(); //rows number

?>