dev-master
9999999-devA mysqli wrapper
MIT
The Requires
- php >=5.3.0
A mysqli wrapper
Please don't use this code... like ever. WAY WAY WAAAAY better options exist nowadays. I'm archiving this repository as well., (*1)
This class is made by unreal4u (Camilo Sperberg). http://unreal4u.com/. However, the initial idea isn't mine, so I would like to thank Mertol Kasanan, this class is based on his work. See http://www.phpclasses.org/browse/package/5191.html for details., (*2)
This package implements a MySQL database access wrapper using the MySQLi extension., (*3)
There is class that manages MySQL database access connections so only one connection is established during the same PHP script execution., (*4)
Another class implements other database access functions like executing queries with prepared queries, measuring the time the queries take to execute and the memory usage, retrieving query results into arrays, the number of result rows, last inserted record identifier and log executed queries to a valid XML log file or directly into your page., (*5)
If the query takes just too long, you can cache the query result into an XML file, and you can also handle errors., (*6)
This package has been extensivily tested with xDebug, APC and Suhosin so that no errors are present., (*7)
include('src/unreal4u/config.php'); // Please see below for explanation include('src/unreal4u/dbmysqli.php'); $dbLink = new unreal4u\dbmysqli(); $id_user = 23; $username = 'unreal4u'; $aResult = $dbLink->query('SELECT id,username FROM users WHERE id = ? AND username = ?',$id_user,$username); foreach($aResult AS $a) { echo 'The id of the user named '.$a['username'].' is: '.$a['id']."\n"; }
$aResult
has the result of your query!unset($aResult);
Add this to your composer.json:, (*8)
{ "require": { "unreal4u/dbmysqli": "@stable" } }
Now you can instantiate a new dbmysqli class by executing:, (*9)
require('vendor/autoload.php'); $rutverifier = new unreal4u\dbmysqli();
Pending --------- * Multiquery support. * Better naming convention to include other RDSMs later on * Convert to PDO (to support :tag type associations), (*10)
4.1.3:, (*11)
5.0.0:, (*12)
A mysqli wrapper
MIT