PHP Classes
elePHPant
Icontem

PDO Wrapper Sky's flavor: Access MySQL databases using PDO

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files Documentation   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2014-07-05 (1 year ago) RSS 2.0 feedNot yet rated by the usersTotal: 280 All time: 6,926 This week: 1,270Up
Version License PHP version Categories  
pdo-wrapper 1.0Freely Distributable5.0PHP 5, Databases
Description Author  

This class can access MySQL databases using PDO.

It can connect to a MySQL server host with a given user name and password and selects a specified database to access.

The class can execute arbitrary SQL queries, retrieve query result records into arrays, execute INSERT queries from parameters, retrieve the last inserted record identifier, etc..

Picture of Legend Foxy
Name: Legend Foxy <contact>
Classes: 1 package by
Country: Australia Australia
Age: ???
All time rank: 352741 in Australia Australia
Week rank: 1483 Up18 in Australia Australia Up

Details provided by the author  
Note: Anything within square brackets ([*]) is not required by default
Note: encode and decode functions are pretty much useless in any kind of production environment.


Connection initiation:
  $mysql = new Database('127.0.0.1', 'pdoUser', 'userPass' [, 'dbName']);

Set the database if not provided earlier:
  $mysql->setDB('dbName');

Insert info into a table:
  $mysql->insert('table_name', array('column_1' => 'info_1' [, 'col2' => 'info2']));

Execute a query:
  $mysql->query('update `lolcats` set `name`=:new where `name`=:old', array('new' => 'sweety', 'old' => 'cuteie'));

Execute a query, returning the rows selected:
  $v = $mysql->fetch_array('select * from `users` where `username`=:user;', array('user' => 'Frankie\'s Dog'));

Hashing:
  $hash = Database::hash('password');
  if(Database::validate('password', $hash))
  {
    // Yippee you logged in ^.^
  }
  Files folder image Files  
File Role Description
Accessible without login Plain text file readme Doc. examples
Plain text file PDO.php Class ...

 Version Control Unique User Downloads Download Rankings  
 0%Total:280All time:6,926
 This week:0This week:1,270Up