PHP Classes

Easy PDO Simple Wrapper: PDO wrapper to execute common SQL queries

Recommend this page to a friend!
  Info   View files Example   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 291 This week: 1All time: 7,489 This week: 560Up
Version License PHP version Categories
simple-pdo-wrapper 1.0.0BSD License5PHP 5, Databases
Description 

Author

This classes is a PDO wrapper to execute common SQL queries.

It can connect to a given database using PDO and can execute common queries. Currently in can:

- Execute arbitrary prepared SQL queries using given parameters array
- Execute SELECT queries an get all records in one array
- Execute SELECT queries an get only one record
- Execute SELECT queries an get only one value

Picture of Mohammad Keramatifar
  Performance   Level  
Name: Mohammad Keramatifar <contact>
Classes: 4 packages by
Country: Iran Iran
Age: 40
All time rank: 7947 in Iran Iran
Week rank: 416 Up4 in Iran Iran Up

Example

<?php
require 'config.php';
require
'class.mrkfPDO.php';

$fullname = mrkfPDO::GetOne("SELECT fullname FROM users WHERE id = 1");
echo
$fullname;

$userInfo = mrkfPDO::GetRow("SELECT * FROM users WHERE id = 1");
print_r($userInfo);

$usersList = mrkfPDO::GetAll("SELECT * FROM users");
print_r($usersList[1]);
print_r($usersList[2]);

// Execute method for INSERT, UPDATE, DELETE
if(mrkfPDO::Execute("SQL INSERT, UPDATE or DELETE queryies"))
{
    echo
'success message';
}


?>


  Files folder image Files  
File Role Description
Plain text file class.mrkfPDO.php Class pdo wrapper class
Accessible without login Plain text file config.php Conf. database configuration
Accessible without login Plain text file example.php Example usage example

 Version Control Unique User Downloads Download Rankings  
 0%
Total:291
This week:1
All time:7,489
This week:560Up