PHP Classes

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

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 291 All time: 7,494 This week: 455Up
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

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 (3)  
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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:291
This week:0
All time:7,494
This week:455Up