Login   Register  
PHP Classes
elePHPant
Icontem

phpPostgreSQLdB: Abstraction layer for PostgreSQL DB

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (1)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2001-08-15 (13 years ago) RSS 2.0 feedStarStarStar 45%Total: 1,284 All time: 2,762 This week: 2,239Up
Version License Categories  
phppostgesqldb 1.0GNU General Public Lice...Databases
Description Author  

Class that provides an abstraction layer above the PHP PostgreSQL API. This centralizes all the database connection info such as host, port, etc. Same class an be used to connect to multiple databases on different servers and on different ports.

In addition to "normal" stuff that you'd expect from a db abstraction layer, it also supports transactions among other things. Comprehensive error checking/management.

Revision History:
*** see class header for revision history ***

Sample usage:

//// Example #1 ////////////////

include("include/dblib.php");
$db = new phpDB();
$db->connect("foobar");
$db->beginTrans();

if (!$db->exec("INSERT INTO weather VALUES ('Vancouver', 1, 5, 0.25)")) {
echo $db->errorMsg();
$db->rollbackTrans();
}

$db->commitTrans();
if (!$db->exec("SELECT * FROM weather"))
echo $db->errorMsg();

//// Example #2 ////////////////

include("include/dbutil.php");
$db = new phpDB();
$db->connect("foobar");
$db->exec("SELECT * from TREVIN");

while ($db->nextRow()) {

// can access like objects!
$rs1 = $db->fobject();
echo "$rs->description : $rs->color : $rs->price <br>";

// Can access like an array!
$rs2 = $db->farray();
echo "$rs2[0] : $rs2[1] : $rs[2] <br>";
}

Picture of tmchow
Name: tmchow <contact>
Classes: 1 package by
Country: United States United States
Age: ???
All time rank: 1827238 in United States United States
Week rank: 1821 Up209 in United States United States Up

  Files folder image Files  
File Role Description
Accessible without login Plain text file dbutil.inc.php ??? Main class file

 Version Control Unique User Downloads Download Rankings  
 0%Total:1,284All time:2,762
 This week:0This week:2,239Up
 User Ratings  
 
 All time
Utility:75%StarStarStarStar
Consistency:75%StarStarStarStar
Documentation:-
Examples:-
Tests:-
Videos:-
Overall:45%StarStarStar
Rank:1906