Login   Register  
PHP Classes
elePHPant
Icontem

Class: DBInterface

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Alejandro Vidal Quiroga  >  DBInterface  >  Download .tar.gz .zip  >  Support forum Support forum  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: DBInterface
Base name: dbinterface
Description: SQL Database abstraction layer
Related classes: , , , , , , ,
Version: -
PHP version: -
License: GNU Lesser General Public License (LGPL)
All time users: 732 users
All time rank: 3671
Week users: 0 users
Week rank: 2507
Picture of Alejandro Vidal Quiroga
Author: Alejandro Vidal Quiroga <e-mail contact>
Packages: 1 Browse this author's classes Browse this author's classes
Country: Argentina Argentina - PHP jobs in Argentina
Age: 31
All time rank: 215426 in Argentina Argentina
Week rank: 2255 Down32 in Argentina Argentina Down


  Detailed description  
This class can be used a SQL database abstraction layer.

It provides a single interface to access several types of SQL databases from the same class. Currently it supports MySQL, PostgreSQL, Interbase and Microsoft SQL server.

It can establish connections to the database server, execute SQL queries, retrieve query results, begin and end transactions, build and execute common types of SQL queries from a list of parameters, generate XML from query results, etc..

The values are retrived from global variables, you only must enter the name. If you want enter the entire format you can do it.

Notice: the field and the global variable must have the same name.

Example:

// In your config file
$CFG_SQL_db = 'dbname';
$CFG_SQL_usuario = 'user';
$CFG_SQL_clave = 'password';
$CFG_SQL_server = 'localhost';
$CFG_SQL_tipo = 'mysql';


// Mysql Code
$dbi = DBI::select('table','field1,field2',"field1 = '$value'");
while($record = $dbi->fetch_object() )
{
echo "Field1: $record->field1";
}

// PostgreSQL
$dbi = DBI::select('table','field1,field2',"field1 = '$value'");
while($record = $dbi->fetch_object() )
{
echo "Field1: $record->field1";
}

// XML Dump
$dbi = new DBI();
echo $dbi->XMLDump('select * from table', 'Records');


// Upload Images
// View Code
<input type="file" name="picture"/>


// Application code (the table has a field named picture with blob type)
dbi::insert('table','picture::blob');

 

  Groups  
Group folder image XML XML parsing and generation View top rated classes
Group folder image Databases Database management, accessing and searching View top rated classes

  Rate classes User ratings   Applications   Files Files  

  User ratings  
There are not enough user ratings to display for this class.

  Applications that use this class  
No application links were specified for this class.
Add link image If you know an application of this package, send a message to the author to add a link here.
  Files folder image Files  
File Role Description
Plain text file dbi.inc.php Class Main FIle

Download all files: dbinterface.tar.gz dbinterface.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.