PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Leonardo Mauro Pereira Moraes   Connection DBMS   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: Connection DBMS
Connect to databases using PDO or MySQLi
Author: By
Last change: Update of README.md
Date: 2 years ago
Size: 1,347 bytes
 

Contents

Class file image Download

Connection Instruction

This package have classes to connection and queries for Database Management System (DBMS [or SGBD, in Portuguese]). Currently it can connect to a database using MySQLi or PDO extension and execute several types of queries from parameters that define tables, fields, values and conditions.

Folder:

  • /php/connection/MysqliInstruction.php `MysqliInstruction()`
  • /php/connection/PDOInstruction.php `PDOInstruction()`

Example

MysqliInstruction()

/Autoload Include/
use \Connection\MysqliInstruction;

$mysqli = new MysqliInstruction();
$mysqli->connect();
$resp = $mysqli->select('SELECT * FROM table WHERE id < ?', array('10'));
$resp = $mysqli->generic('DELETE FROM table WHERE id = ?', array('2'));
var_dump($resp);
$mysqli->end();

PDOInstruction()

/Autoload Include/
use \Connection\PDOInstruction;

$pdo = new PDOInstruction();
$pdo->connect();
$resp = $pdo->select('SELECT * FROM table WHERE id < ?', array('10'));
$resp = $pdo->generic('DELETE FROM table WHERE id = ?', array('2'));
var_dump($resp);
$pdo->end();

Also look ~