2017 © Pedro Peláez
 

library simple-pdo

A simpe PDO class for MariaDB and MySQL

image

abbe98/simple-pdo

A simpe PDO class for MariaDB and MySQL

  • Thursday, February 9, 2017
  • by Abbe98
  • Repository
  • 2 Watchers
  • 6 Stars
  • 171 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 6 Forks
  • 3 Open issues
  • 6 Versions
  • 4 % Grown

The README.md

Simple PDO

Secure and simple library for PHP's PDO class., (*1)

Installation

Install the composer package., (*2)

composer require abbe98/simple-pdo

In define your database connection/user details using constants:, (*3)

const HOST = '' // the IP of the database
const DBNAME = '' // the database name to be used
const USERNAME = '' // the username to be used with the database
const PASSWORD = '' // the password to be used with the username

Usage Examples

Create new SimplePDO instance and open a connection:, (*4)

$database = SimplePDO::getInstance();`

If there is already a open connection that one will be used automatically., (*5)

Query database and return a single row:, (*6)

$database = SimplePDO::getInstance();
$database->query("SELECT `column` FROM `table` WHERE `columnValue` = :id");
$database->bind(':id', 123);
$result = $database->single();

Query database and return multiply rows:, (*7)

$database = SimplePDO::getInstance();
$database->query("SELECT * FROM `table`");
$result = $database->resultSet();

Insert new row in database:, (*8)

$database = SimplePDO::getInstance();
$database->query("INSERT INTO `users` (name, email) VALUES (:name, :email)");
$database->bind(':name', $name);
$database->bind(':name', $email);
$database->execute();

Update existing row:, (*9)

$database = SimplePDO::getInstance();
$database->query("UPDATE `users` SET `name` = :name WHERE `id` = :id");
$database->bind(':name', $newName);
$database->bind(':id', $id);
$database->execute();

The Versions

09/02 2017

dev-master

9999999-dev https://github.com/Abbe98/Simple-PDO

A simpe PDO class for MariaDB and MySQL

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

database pdo mysql mariadb

09/02 2017

2.1.0

2.1.0.0 https://github.com/Abbe98/Simple-PDO

A simpe PDO class for MariaDB and MySQL

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

database pdo mysql mariadb

23/12 2014

2.0.0

2.0.0.0 https://github.com/Abbe98/Simple-PDO

A simpe PDO class for MariaDB and MySQL

  Sources   Download

MIT

The Requires

  • php >=5.0.0

 

database pdo mysql mariadb

05/10 2014

1.2.0

1.2.0.0 https://github.com/Abbe98/Simple-PDO

A simpe PDO class for MariaDB and MySQL

  Sources   Download

MIT

The Requires

  • php >=5.0.0

 

database pdo mysql mariadb

09/09 2014

1.1.0

1.1.0.0 https://github.com/Abbe98/Simple-PDO

A simpe PDO class for MariaDB and MySQL

  Sources   Download

MIT

The Requires

  • php >=5.0.0

 

database pdo mysql mariadb

11/08 2014

1.0.0

1.0.0.0 https://github.com/Abbe98/Simple-PDO

A simpe PDO class for MariaDB and MySQL

  Sources   Download

MIT

The Requires

  • php >=5.0.0

 

database pdo mysql mariadb