2017 © Pedro Peláez
 

library mysql-reconnect

A PDO wrapper that reconnects automatically and re-issues queries on receiving MySQL server timeout errors

image

fbf/mysql-reconnect

A PDO wrapper that reconnects automatically and re-issues queries on receiving MySQL server timeout errors

  • Monday, October 14, 2013
  • by neilcrookes
  • Repository
  • 1 Watchers
  • 1 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

MySQL-Reconnect

A PDO wrapper that reconnects automatically and re-issues queries on receiving MySQL server timeout errors, (*1)

Usage

$config = array(
    'driver' => 'mysql',
    'host' => 'localhost',
    'database' => 'mydb',
    'user' => 'username',
    'pass' => 'password',
);

$db = new Fbf\MysqlReconnect\Db($config);

$sql = "SELECT * FROM posts WHERE id = :id";

$data = array('id' => 1);

$sth = $db->query($sql, $data);

$post = $sth->fetchObj();

How it works

Uses __call() magic method to pass off methods called to the PDO connection object, so you can call whatever you like on $db and it will pass it off to PDO. Inside the magic method we catch timeout exceptions and then reconnect before re-issuing the query., (*2)

The Versions

14/10 2013

dev-master

9999999-dev

A PDO wrapper that reconnects automatically and re-issues queries on receiving MySQL server timeout errors

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

14/10 2013

v0.1.0

0.1.0.0

A PDO wrapper that reconnects automatically and re-issues queries on receiving MySQL server timeout errors

  Sources   Download

MIT

The Requires

  • php >=5.3.0