Login   Register  
PHP Classes
elePHPant
Icontem

File: ex-Db.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of carex  >  Form Table PgSQL  >  ex-Db.php  >  Download  
File: ex-Db.php
Role: Example script
Content type: text/plain
Description: example Db
Class: Form Table PgSQL
Generate Web forms to access PostgreSQL tables
Author: By
Last change:
Date: 2005-09-20 22:37
Size: 881 bytes
 

Contents

Class file image Download
<?php
    
require 'conf/dbConf.php';
    require 
'object/database/dbConnection.php';
    
    
//create new
    
$db1=new pgsqldb();

    
//for select
    
$db1->DbQuery="SELECT * FROM sch_user.t_base";
    
$db1->GetDbQuery('SELECT');
    for(
$i=0$i $db1->DbNumRows$i++){
      for(
$j=0$j $db1->DbNumCols$j++){
        print 
$db1->Data[$i][$j]."------";
      }
      print 
"<br>";
    }
    
    
//for delete
//    $db1->dbQuery="DELETE FROM sch_user.t_base WHERE id=100202020";
//    db1->get_dbQuery('DELETE');
    
    //for update
//    $db1->dbQuery="UPDATE sch_user.t_base SET nama='CAREX' WHERE id=20";
//    $db1->get_dbQuery('UPDATE');

    //for insert
//    $db1->dbQuery="INSERT INTO sch_user.t_base(id,nama) VALUES(101,'Windy')";
//    $db1->get_dbQuery('INSERT');

    // NB: Anything depend of SQL Syntax for PostgreSQL

?>