zhkugh/epdo

v1.2 2019-12-24 06:56 UTC

This package is auto-updated.

Last update: 2024-04-27 11:28:46 UTC


README

A PDO Library.

Create a easy Database App: Connecting to MySQL with PHP.

Build Status StyleCI build status

Installing

$ composer require zhkugh/epdo -vvv

Usage

<?php

require __DIR__."/vendor/autoload.php";

use Zhkugh\Epdo\DB;

// query
$sql = "CREATE TABLE IF NOT EXISTS `travis` (
     	`id` INT(11) NOT NULL AUTO_INCREMENT,
     	`content` text,
     	PRIMARY KEY (`id`)
     ) COLLATE = 'utf8_general_ci' ENGINE = InnoDB AUTO_INCREMENT = 1;";

$bool = DB::query($sql);

// insert
$rowCount = DB::insert('travis', [
    'content' => 'test',
]);

// update
$rowCount = DB::update('travis', [
    'content' => 'NEW VALUE',
], 'id=1');

// run
$PDOStatement = DB::run('SELECT * FROM travis;');

$list = $PDOStatement->fetchAll();

// delete
$rowCount = DB::delete('travis', 'id=1');

Contributing

You can contribute in one of three ways:

  1. File bug reports using the issue tracker.
  2. Answer questions or fix bugs on the issue tracker.
  3. Contribute new features or update the wiki.

The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.

License

MIT