PHP Classes

File: ibase_classtest.php

Recommend this page to a friend!
  Classes of Martin Fasani   Interbase with error logging   ibase_classtest.php   Download  
File: ibase_classtest.php
Role: Example script
Content type: text/plain
Description: Instantiation example
Class: Interbase with error logging
Interbase access wrapper. Conn/Query errors logged
Author: By
Last change: Removed some unnecesary comments
Date: 17 years ago
Size: 605 bytes
 

Contents

Class file image Download
<?php
require_once("ibclass.php");
$ib = New ib('127.0.0.1:DEMO.GDB','SYSDBA','password',1);

function
query() {
  global
$ib;
 
$query=$ib->query("select * from TABLE1");
   
$out=""; //Defining output var
   
$count=0;
  while (
$row = ibase_fetch_assoc($query)) {

    foreach (
$row as $rname=>$rvalue) {
      
$out.="$rname=>$rvalue,";
       }

      
$count++; //interbase has not the numrows property as mysql, so you should make your own counter.
      
$out.="<br>";
   }

  
$out.="NUMROWS:$count";
 
$ib->free_result ();
  return
$out;
}

echo
query();
$ib->disconnect();
?>