A long time in my private projects i use class what im made for MySQL Managment scripts which are an integral Frameworks and I pulled the best,faster and high security resolve for managment MySQL DB.I use in all projects PDO and I wanted to share with you for easier job and help in development production for MySQL security
Than lets start
How to install ?
Class is group the most important of all PDO functions with that as the use of a lot simplified.First unpackage archive,all files and folders transfer in reproduction folder of your script than in the beginning of its turn one file - config.php in my example
<?php
include_once "config.php";
?>
How to use class ?
Inquiry (MySQL Query)
<?php
$SQL = "SELECT FROM Table";
$DataBase->Query($SQL);
?>
These scripts start the transaction and database
Feedback (MySQL Result)
<?php
$SQL = "SELECT FROM Table";
$DataBase->Query($SQL);
$DataBase->Execute();
// $Result = $DataBase->Single(); - One result.
// $Results = $DataBase->ResultSet(); - All results (string).
?>
Bind Data with Query (MySQL Bind)
<?php
$ID = "1";
$SQL = "SELECT FROM Table WHERE ID = :ID";
$DataBase->Query($SQL);
$DataBase->Bind(':ID', $ID); // Can use more times in string, for various parameters.
$DataBase->Execute();
// $Result = $DataBase->Single(); - One result.
// $Results = $DataBase->ResultSet(); - All results (String).
?>
Counting results (MySQL Row Count)
<?php
$SQL = "SELECT FROM Table";
$DataBase->Query($SQL);
$DataBase->Execute();
$ResultsCount = $DataBase->RowCount(); - One result.
?>
Other functions
<?php
$DataBase->LastID(); // Last ID.
$DataBase->StartTransaction(); // Start transaction.
$DataBase->EndTransaction(); // End transaction.
$DataBase->CancelTransaction(); // Cancel transaction (Eliminate all entered during the same).
$DataBase->DebugParams(); // Parameters for debug.
?>
I hope I have helped someone.