Ratings | | Unique User Downloads | | Download Rankings |
51% | | Total: 760 | | All time: 4,441 This week: 44 |
|
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. | |
|
|
Innovation award
Nominee: 1x |
|
Recommendations
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";
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.