2017 © Pedro Peláez
 

library pdo

PDO database library for Slim Framework

image

slim/pdo

PDO database library for Slim Framework

  • Wednesday, March 21, 2018
  • by FaaPz
  • Repository
  • 24 Watchers
  • 237 Stars
  • 83,056 Installations
  • PHP
  • 13 Dependents
  • 0 Suggesters
  • 80 Forks
  • 43 Open issues
  • 20 Versions
  • 13 % Grown

The README.md

PDO

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

Just another PDO database library, (*2)

Installation

Use Composer, (*3)

$ composer require faapz/pdo 

Usage

Examples selecting, inserting, updating and deleting data from or into users table., (*4)

require_once 'vendor/autoload.php';

$dsn = 'mysql:host=your_db_host;dbname=your_db_name;charset=utf8';
$usr = 'your_db_username';
$pwd = 'your_db_password';

$database = new FaaPz\PDO\Database($dsn, $usr, $pwd);

// SELECT * FROM users WHERE id = ?
$select = $database->select()
                   ->from('users')
                   ->where(new FaaPz\PDO\Clause\Conditional('id', '=', 1234));

if ($insert->execute()) {
    $data = $stmt->fetch();
}

// INSERT INTO users (id , username , password) VALUES (? , ? , ?)
$insert = $database->insert(
                       'id',
                       'username',
                       'password'
                   )
                   ->into('users')
                   ->values(
                       1234,
                       'user',
                       'passwd'
                   );

if ($insert->execute()) {
    $insertId = $database->lastInsertId();
}

// UPDATE users SET pwd = ? WHERE id = ?
$update = $database->update(["pwd" => "your_new_password"])
                   ->table("users")
                   ->where(new FaaPz\PDO\Clause\Conditional("id", "=", 1234));

if (($result = $insert->execute()) !== false) {
    $affectedRows = $result->rowCount();
}

// DELETE FROM users WHERE id = ?
$delete = $database->delete()
                   ->from("users")
                   ->where(new FaaPz\PDO\Clause\Conditional("id", "=", 1234));

if (($result = $delete->execute()) !== false) {
    $affectedRows = $result->rowCount();
}

The sqlsrv extension will fail to connect when using error mode PDO::ERRMODE_EXCEPTION (default). To connect, you will need to explicitly pass array(PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING) (or PDO::ERRMODE_SILENT) into the constructor, or override the getDefaultOptions() method when using sqlsrv., (*5)

Documentation

See DOCUMENTATION, (*6)

Changelog

See CHANGELOG, (*7)

License

See LICENSE, (*8)

The Versions

21/03 2018

dev-v2-dev

dev-v2-dev https://github.com/FaaPz/Slim-PDO

PDO database library for Slim Framework

  Sources   Download

MIT

The Requires

  • ext-pdo *
  • php >=5.6.0

 

The Development Requires

database framework pdo slim

15/08 2017

dev-master

9999999-dev https://github.com/FaaPz/Slim-PDO

PDO database library for Slim Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-pdo *

 

database framework pdo slim

15/08 2017

1.10.1

1.10.1.0 https://github.com/FaaPz/Slim-PDO

PDO database library for Slim Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-pdo *

 

database framework pdo slim

14/08 2016

1.10.0

1.10.0.0 https://github.com/FaaPz/Slim-PDO

PDO database library for Slim Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-pdo *

 

database framework pdo slim

29/05 2016

1.9.9

1.9.9.0 https://github.com/FaaPz/Slim-PDO

PDO database library for Slim Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-pdo *

 

database framework pdo slim

27/02 2016

1.9.8

1.9.8.0 https://github.com/FaaPz/Slim-PDO

PDO database library for Slim Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-pdo *

 

database framework pdo slim

27/02 2016

1.9.7

1.9.7.0 https://github.com/FaaPz/Slim-PDO

PDO database library for Slim Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-pdo *

 

database framework pdo slim

03/02 2016

1.9.6

1.9.6.0 https://github.com/FaaPz/Slim-PDO

PDO database library for Slim Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-pdo *

 

database framework pdo slim

23/01 2016

1.9.5

1.9.5.0 https://github.com/FaaPz/Slim-PDO

PDO database library for Slim Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-pdo *

 

database framework pdo slim

20/01 2016

1.9.4

1.9.4.0 https://github.com/FaaPz/Slim-PDO

PDO database library for Slim Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-pdo *

 

database framework pdo slim

12/01 2016

1.9.3

1.9.3.0 https://github.com/FaaPz/Slim-PDO

PDO database library for Slim Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-pdo *

 

database framework pdo slim

28/12 2015

1.9.2

1.9.2.0 https://github.com/FaaPz/Slim-PDO

PDO database library for Slim Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-pdo *

 

database framework pdo slim

02/12 2015

1.9.1

1.9.1.0 https://github.com/FaaPz/Slim-PDO

PDO database library for Slim Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-pdo *

 

database framework pdo slim

30/11 2015

1.9.0

1.9.0.0 https://github.com/FaaPz/Slim-PDO

PDO database library for Slim Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-pdo *

 

database framework pdo slim

22/11 2015

1.8.2

1.8.2.0 https://github.com/FaaPz/Slim-PDO

PDO database library for Slim Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-pdo *

 

database framework pdo slim

07/10 2015

1.8.1

1.8.1.0 https://github.com/FaaPz/Slim-PDO

PDO database library for Slim Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-pdo *

 

database framework pdo slim

14/09 2015

1.8.0

1.8.0.0 https://github.com/FaaPz/Slim-PDO

PDO database library for Slim Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-pdo *

 

database framework pdo slim

08/08 2015

1.7.2

1.7.2.0 https://github.com/FaaPz/Slim-PDO

PDO database library for Slim Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-pdo *

 

database framework pdo slim

08/08 2015

1.7.1

1.7.1.0 https://github.com/FaaPz/Slim-PDO

PDO database library for Slim Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-pdo *

 

database framework pdo slim

25/07 2015

1.7.0

1.7.0.0 https://github.com/FaaPz/Slim-PDO

PDO database library for Slim Framework

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-pdo *

 

database framework pdo slim