PHP Classes

PHP MySQL Connectors: Execute MySQL and PostGreSQL queries using PDO

Recommend this page to a friend!

  Author Author  
Picture of Hicri
Name: Hicri <contact>
Classes: 15 packages by
Country: Turkey Turkey
Innovation award
Innovation award
Nominee: 2x


  Detailed description   Download Download .zip .tar.gz  
This package can execute MySQL and PostgreSQL queries using PDO.

It provides a class that can return constant parameters to connect to a database.

Another class can connect to a MySQL or PostgreSQL database using PDO.

It also provides another class that can perform common SQL queries like SELECT, INSERT, UPDATE, and DELETE using parameters that define tables, fields, field values, and conditions.

Details

Slvler - php-mysql-connectors

Mysql driver development that can be used on the php side

Installation

To install this package tou can use composer:

    composer require slvler/mysql-connectors

Usage


use slvler\mysqlconnectors\Constant;
use slvler\mysqlconnectors\Config\Method;
use slvler\mysqlconnectors\Database\DatabaseController;


$Constant = new Constant();

$db = new DatabaseController($Constant->showDBHost(), $Constant->showDBName(), $Constant->showDBUser(), $Constant->showDBPassword(), $Constant->showConnection());

Basic Table // use northwind

table "orders"

| OrderID | EmployeeID | ShipName |:-----------:|:------------:|:------------:| | 10249 | 6 | red | 10250 | 4 | yellow | 10251 | 3 | green | 10252 | 4 | yellow | 10253 | 3 | red

Insert Method (TableName, Data = array()):

TableName, Data:

$tableName = "Orders";

$data = Array
(
  "ShipName" => "Blue",
  "ShipAddress" => "Nottingham",
  "ShipCity" => "UK"
);

Insert Method


$methodInsert = $method->Insert($tableName,$data);

Update Method (TableName, Id = array() , Data = array()):

TableName, Id , Data:

$tableName = "Orders";

$Id = array(
 "OrderID" => "1"
);

$data = Array
(
  "ShipName" => "Blue",
  "ShipAddress" => "Nottingham",
  "ShipCity" => "UK"
);

Update Method


$methodUpdate = $method->Update($tableName', $id, $data);

Delete Method (TableName, Id = array()):

TableName, Id:

$tableName = "Orders";

$Id = array(
 "OrderID" => "1"
);

Delete Method


$methodDelete = $method->Delete($tableName,$id);

Select_all Method (TableName):

TableName:

$tableName = "Orders";

Select_all Method


$methodSelectAll = $method->Select_all($tableName);

Select_ch Method (TableName, Data = array()):

TableName, Data:

$tableName = "Orders";

$data = Array
(
  "ShipName", "ShipAddress", "ShipCity"
);

Select_ch Method


$methodSelectCh = $method->Select_ch($tableName,$data);

Select_wh Method (TableName, Data = array(), Conn = array(), If = array()):

TableName, Data, Conn, If:

$tableName = "Orders";

$data = Array
(  
    "EmployeeID" => "4"
);

$conn = Array
(  
    "!="
);

$if = Array
(  
    "AND"
);

Select_wh Method


$methodSelectWh =  $method->Select_wh($tableName, $data, $conn, $if);

Testing

vendor\bin\phpunit

Credits

License

The MIT License (MIT). Please see License File for more information.


  Classes of Hicri  >  PHP MySQL Connectors  >  Download Download .zip .tar.gz  >  Support forum Support forum  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: PHP MySQL Connectors
Base name: php-mysql-connectors
Description: Execute MySQL and PostGreSQL queries using PDO
Version: -
PHP version: 5
License: The PHP License
 
  Groups   Applications   Files Files  

  Groups  
Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes
Group folder image Databases Database management, accessing and searching View top rated classes
Group folder image Configuration Configuration formats parsing and generation View top rated classes


  Applications that use this package  
No pages of applications that use this class were specified.

Add link image If you know an application of this package, send a message to the author to add a link here.

  Files folder image Files  
File Role Description
Files folder imageexample (1 file)
Files folder imagesrc (1 file, 2 directories)
Files folder imagetests (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE.md Lic. License text
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  example  
File Role Description
  Accessible without login Plain text file index.php Example Example script

  Files folder image Files  /  src  
File Role Description
Files folder imageConfig (3 files)
Files folder imageDatabase (3 files)
  Plain text file Constant.php Class Class source

  Files folder image Files  /  src  /  Config  
File Role Description
  Plain text file Method.php Class Class source
  Plain text file Sql.php Class Class source
  Plain text file SqlPattern.php Class Class source

  Files folder image Files  /  src  /  Database  
File Role Description
  Plain text file Database.php Class Class source
  Plain text file DatabaseController.php Class Class source
  Plain text file DatabaseFace.php Class Class source

  Files folder image Files  /  tests  
File Role Description
  Plain text file ConnectionTest.php Class Class source

Download Download all files: php-mysql-connectors.tar.gz php-mysql-connectors.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.
  Files folder image Files  
File Role Description
Files folder imageexample (1 file)
Files folder imagesrc (1 file, 2 directories)
Files folder imagetests (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE.md Lic. License text
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  example  
File Role Description
  Accessible without login Plain text file index.php Example Example script

  Files folder image Files  /  src  
File Role Description
Files folder imageConfig (3 files)
Files folder imageDatabase (3 files)
  Plain text file Constant.php Class Class source

  Files folder image Files  /  src  /  Config  
File Role Description
  Plain text file Method.php Class Class source
  Plain text file Sql.php Class Class source
  Plain text file SqlPattern.php Class Class source

  Files folder image Files  /  src  /  Database  
File Role Description
  Plain text file Database.php Class Class source
  Plain text file DatabaseController.php Class Class source
  Plain text file DatabaseFace.php Class Class source

  Files folder image Files  /  tests  
File Role Description
  Plain text file ConnectionTest.php Class Class source

Download Download all files: php-mysql-connectors.tar.gz php-mysql-connectors.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.