PHP Classes

File: test.php

Recommend this page to a friend!
  Classes of Ruben Sekiji Negrao Doi   GV RecordSet Class   test.php   Download  
File: test.php
Role: Example script
Content type: text/plain
Description: Example Script File
Class: GV RecordSet Class
Retrieve database query result records
Author: By
Last change:
Date: 16 years ago
Size: 2,175 bytes
 

Contents

Class file image Download
<?php

# ====================================================================
# = This class are implemented only for MYSQL database =
# = Pay Attecion on the future updates, new DBMS will =
# = be included on it. =
# = =
# = Any questions, problems, report me! =
# = sekiji@gmail.com =
# = =
# = Best Regards from Brazil! =
# = Sekiji. =
# ====================================================================

# includes
include_once("class_Conection.php");
include_once(
"class_RecordSet.php");

# EXAMPLE SCRIPT - How to use the GV RecordSet Class
# The class was base on the ADO Record Set Logic.
# First we need to declare and create a conection object
$conn = new conection();

# Then we create a Recordset object, that needs the conection object as parameter
$rs = new RecordSet($conn);

# Now we make a SQL comand to bring what we need from de database.
$strSQL = "SELECT rep_str_texto FROM replys";

# Open() method contains a sql comand as parameter.
$rs->open($strSQL);

# Finally all methods are ready to use.
$rs->bof; # ( Boolean ) Flag BOF : Begin of File.
$rs->eof; # ( Boolean ) Flag EOF : End of File. Boolean
$rs->field("name of the field"); # ( String ) Call the current registerīs Field by the name.
$rs->field(1); # ( String ) You may also call the field by the number. Camuflated Polimorphism =).
$rs->first(); # ( Void ) Pointer now points to the first register.
$rs->last(); # ( Void ) Pointer now points to the last register.
$rs->next(); # ( Void ) Pointer to next register.
$rs->previous(); # ( Void ) Pointer to previous register.
$rs->count_registers(); # ( Integer ) Returns the total of fields that recordset contains.

# simple loop to show all registers
while(!$rs->eof){
    echo(
$rs->field("rep_str_texto") . "<BR>");
   
$rs->next();
}

?>