PHP Classes

DbUtils: Access and Manage MySQL, PostgreSQL or MS SQL

Recommend this page to a friend!
  Info   View files Example   View files View files (14)   DownloadInstall with Composer Download .zip   Reputation   Support forum (5)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 55%Total: 759 This week: 1All time: 4,445 This week: 560Up
Version License PHP version Categories
dbutilspdo 1.9MIT/X Consortium ...5.1PHP 5, Databases
Description 

Author

This package can Access and Manage MySQL, PostgreSQL or Microsoft SQL database using PHP Data Objects (PDO).

It can establish database connections extending PDO class and perform several types of queries.

The class can execute arbitrary queries, select queries that return one row, queries that return a range of result set rows, execute INSERT and UPDATE queries, retrieve the last inserted record identifier or the next record sequence value, begin, commit and rollback transactions.

Picture of Kakhaber Kashmadze
Name: Kakhaber Kashmadze <contact>
Classes: 4 packages by
Country: Georgia Georgia
Age: 50
All time rank: 21272 in Georgia Georgia
Week rank: 416 Up1 in Georgia Georgia Up
Innovation award
Innovation award
Nominee: 1x

Recommendations

PDO SQL server connection and execution of stored procedures
want to connect execute sql queries and stored procedures

Example

<?php
# Example for class DbUtils\Db
# Writen By Kakhaber Kashmadze <info@soft.ge>

#for this example use test-mysql.sql from folder ../sql/

use DbUtils\Db;
use
DbUtils\Helper\HelperDb;

define('INCLUDE_DIR',dirname(dirname(__FILE__)).'/include');
define('CLASSES_DIR',INCLUDE_DIR.'/classes');

require_once
'params.php';

$dbMapper=new DbMapper(array(
   
'type'=>'mysql',
   
'host'=>DBHOST,
   
'name'=>DBNAME,
   
'user'=>DBUSER,
   
'password'=>DBPASS,
   
'port'=>3306
));

Db::init($dbMapper->getDbparams(), $dbMapper->getDb());

require_once
'include/classes/DbUtils/Db.php';
require_once
'include/classes/DbUtils/DbMapper.php';
require_once
'include/classes/DbUtils/Helper/HelperDb.php';


Db::init($dbMapper->getDbparams(), $dbMapper->getDb());


Retrieve one row from table users:

$row=Db::fetchRow("select lname, fname from users where id=1");
echo
$row['lname']." ".$row['fname']."\n";

?>


Details

Database Utilities

Access and Manage MySQL, PostgreSQL, MicrosoftSQL database using PHP Data Objects (PDO)


use DbUtils\Db;
use DbUtils\Helper\HelperDb;

define('INCLUDE_DIR',dirname(dirname(__FILE__)).'/include');
define('CLASSES_DIR',INCLUDE_DIR.'/classes');

require_once 'params.php';

$dbMapper=new DbMapper(array(
	'type'=>'mysql',
	'host'=>DBHOST,
	'name'=>DBNAME,
	'user'=>DBUSER,
	'password'=>DBPASS,
	'port'=>3306
));

Db::init($dbMapper->getDbparams(), $dbMapper->getDb());

require_once 'include/classes/DbUtils/Db.php';
require_once 'include/classes/DbUtils/DbMapper.php';
require_once 'include/classes/DbUtils/Helper/HelperDb.php';


Db::init($dbMapper->getDbparams(), $dbMapper->getDb());


Retrieve one row from table users:

$row=Db::fetchRow("select lname, fname from users where id=1");
echo $row['lname']." ".$row['fname']."\n";

  Files folder image Files  
File Role Description
Files folder imageinclude (1 file, 1 directory)
Files folder imagepublic_html (3 files)
Files folder imagesql (2 files)
Accessible without login Plain text file changelog.txt Doc. Documentation
Accessible without login Plain text file LICENSE Lic. License Text
Accessible without login Plain text file README.md Data Auxiliary data

  Files folder image Files  /  include  
File Role Description
Files folder imageclasses (1 file, 1 directory)
  Accessible without login Plain text file functions.php Aux. alternative functions of php: empty and var_dump

  Files folder image Files  /  include  /  classes  
File Role Description
Files folder imageDbUtils (3 files, 1 directory)
  Plain text file DbUtils.php Class Class source

  Files folder image Files  /  include  /  classes  /  DbUtils  
File Role Description
Files folder imageHelper (1 file)
  Plain text file Db.php Class DbUtils/Db.php
  Plain text file DbAddons.php Class Class source
  Plain text file DbMapper.php Class DbUtils/DbMapper.php

  Files folder image Files  /  include  /  classes  /  DbUtils  /  Helper  
File Role Description
  Plain text file HelperDb.php Class DbUtils/Helper/HelperDb.php

  Files folder image Files  /  public_html  
File Role Description
  Accessible without login Plain text file example-old.php Example old example
  Accessible without login Plain text file example.php Example Example script
  Accessible without login Plain text file LICENSE Lic. License text

  Files folder image Files  /  sql  
File Role Description
  Accessible without login Plain text file test-mysql.sql Data Auxiliary data
  Accessible without login Plain text file test-postgresql.sql Data Auxiliary data

 Version Control Unique User Downloads Download Rankings  
 100%
Total:759
This week:1
All time:4,445
This week:560Up
User Ratings User Comments (1)
 All time
Utility:68%StarStarStarStar
Consistency:75%StarStarStarStar
Documentation:75%StarStarStarStar
Examples:56%StarStarStar
Tests:-
Videos:-
Overall:55%StarStarStar
Rank:1970