2017 © Pedro Peláez
 

library devstart-db

image

artemmelnik/devstart-db

  • Friday, July 27, 2018
  • by artemmelnik
  • Repository
  • 0 Watchers
  • 2 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Class Database (PDO)

  1. Install, (*1)

    composer require artemmelnik/devstart-db
    
  2. Use, (*2)

Select

```php <?php, (*3)

require_once DIR . '/vendor/autoload.php';, (*4)

use DevStart\Database;, (*5)

$db = new Database([ 'host' => 'localhost', 'dbname' => 'devstart_db', 'user' => 'root', 'password' => 'root', 'charset' => 'utf8' ]);, (*6)

$query = $db->query('SELECT * FROM posts ORDER BY id DESC');, (*7)

$db->closeConnection();, (*8)


###Insert ```php <?php $insert = $db->query("INSERT INTO posts (title, content) VALUES (:title, :content)", [ 'title' => 'Hello World', 'content' => 'Wrire content' ]);

The Versions

27/07 2018

dev-master

9999999-dev https://github.com/artemmelnik/database

  Sources   Download

by Artem Melnik

27/07 2018

0.1

0.1.0.0

  Sources   Download

by Artem Melnik