PHP Classes
Icontem

File: ibase_classtest.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Martin Fasani  >  Interbase with error logging  >  ibase_classtest.php  
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
 

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();
?>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products