Connection DBMS: Connect to databases using PDO or MySQLi

Recommend this page to a friend!
  Info   Documentation   View files (8)   Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 384 All time: 6,581 This week: 298
Version License PHP version Categories
connection_dbms 1.1.1MIT/X Consortium ...5PHP 5, Databases, Libraries
Description Author

This package can connect to databases using PDO or MySQLi.

It provides two classes: one to connect to a database using PDO and another to connect to MySQL using MySQLi.

Both classes can execute prepared queries from parameters and return the results in arrays.

Recommendations

PDO Class
I need a class to connect to my db (mysql). Now my code is a old

Picture of Leonardo Mauro Pereira Moraes
  Performance   Level  
Name: Leonardo Mauro Pereira ... <contact>
Classes: 3 packages by
Country: Brazil Brazil
Age: 26
All time rank: 2862211 in Brazil Brazil
Week rank: 771 43 in Brazil Brazil

Details

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 ~

  Files  
File Role Description
class (2 files)
dist (1 directory)
example (1 file)
LICENSE Lic. License text
README.md Doc. Documentation

  Files  /  class  
File Role Description
   class.mysqli.instruction.php Class Class source
   class.pdo.instruction.php Class Class source

  Files  /  dist  
File Role Description
php (1 file, 1 directory)

  Files  /  dist  /  php  
File Role Description
connection (2 files)
   autoload.php Aux. Auxiliary script

  Files  /  dist  /  php  /  connection  
File Role Description
   MysqliInstruction.php Class Class source
   PDOInstruction.php Class Class source

  Files  /  example  
File Role Description
   index.php Example Example script

 Version Control Unique User Downloads Download Rankings  
 100%
Total:384
This week:0
All time:6,581
This week:298

For more information send a message to info at phpclasses dot org.