2017 © Pedro Peláez
 

library db-php

PDO wrapper which enable to use Relational DataBase without SQL.

image

seiryow/db-php

PDO wrapper which enable to use Relational DataBase without SQL.

  • Saturday, January 4, 2014
  • by seiryow
  • Repository
  • 1 Watchers
  • 0 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

db-php

PDO wrapper, (*1)

index.php


//CONNECT DB //SQLITE $dbtype = "sqlite"; $dbname = "./test.db"; $table = "test"; $test = new DB($dbtype, $dbname, $table, null, null); ////MYSQL //$dbtype = "mysql"; //$host = "localhost"; //$dbname = "test"; //$table = "testtbl"; //$user = "root"; //$pass = ""; //$test = new DB($dbtype, "host={$host};dbname={$dbname}", $table, $user, $pass); //CREATE TABLE $schema = array (); $schema["testint"] = "INTEGER"; $schema["testtxt"] = "TEXT"; $test->create($schema); //INSERT $data = array (); $data["testint"] = 123; $test->insert($data); $data["testint"] = 456; $data["testtxt"] = "abc"; $test->insert($data); $data["testint"] = 456; $data["testtxt"] = "xyz"; $test->insert($data); $data["testint"] = 789; $data["testtxt"] = "def"; $test->insert($data); //SELECT ALL $r = $test->selectAll(); //dump($r); //SELECT $where = array (); $where["testint"] = 456; $r = $test->select($where); //dump($r); //UPDATE $where = array (); $update = array (); $where["testint"] = 789; $update["testtxt"] = "ghi"; $test->update($update, $where); $r = $test->select($where); //dump($r); $test->insert($data); $r = $test->selectAll(); //dump($r); //SELECT by LIKE $where = array (); $where["testtxt"] = array ( "like" => "b" ); $r = $test->select($where); //dump($r); //SELECT with AND $where = array (); $where["testint"] = 456; $update["testtxt"] = "xyz"; $r = $test->select($where); //dump($r); //SELECT with OR $where = array (); $where["testtxt"] = array ( "" => "abc", "" => "xyz" ); $r = $test->select($where); //dump($r);

The Versions

04/01 2014

dev-master

9999999-dev https://github.com/seiryow/db-php

PDO wrapper which enable to use Relational DataBase without SQL.

  Sources   Download

Apache-2.0

by Avatar seiryow

query pdo

02/01 2014

0.0.6

0.0.6.0 https://github.com/seiryow/db-php

PDO wrapper which enable to use Relational DataBase without SQL.

  Sources   Download

Apache-2.0

by Avatar seiryow

query pdo

02/01 2014

0.0.7

0.0.7.0 https://github.com/seiryow/db-php

PDO wrapper which enable to use Relational DataBase without SQL.

  Sources   Download

Apache-2.0

by Avatar seiryow

query pdo

02/01 2014

0.0.2

0.0.2.0

  Sources   Download

02/01 2014

0.0.1

0.0.1.0

  Sources   Download

02/01 2014

0.0.3

0.0.3.0

  Sources   Download