2017 © Pedro Peláez
 

library dhtmlsql

An ultra-modern, advanced, compact and lightweight MySQL database wrapper library, built around PHP's MySQLi extension.

image

dhtml/dhtmlsql

An ultra-modern, advanced, compact and lightweight MySQL database wrapper library, built around PHP's MySQLi extension.

  • Wednesday, March 23, 2016
  • by dhtml
  • Repository
  • 1 Watchers
  • 0 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

DHTMLSQL

Total Downloads Latest Stable Version License, (*1)

What am I looking at?

You are looking at An advanced, compact and lightweight MySQL database wrapper library, built around PHP's mysqli extension. It provides methods for interacting with MySQL databases that are more powerful and intuitive than PHP’s default ones., (*2)

Features

  • It uses the mysqli extension for communicating with the database instead of the old mysql extension, which is officially deprecated as of PHP v5.5.0 and will be removed in the future; again, this is not a wrapper for the PDO extension which is already a wrapper in itself
  • It offers lots of powerful methods for easier interaction with MySQL
  • It provides a better security layer by encouraging the use of prepared statements, where parameters are automatically escaped.
  • It has comprehensive documentation and examples of usage included
  • It allows easy ways of backing up and restoring your database.

Installation and Usage

One of the main goals of DHTMLSQL is to be zero setup., (*3)

Download the archive and simply, (*4)

<?php
require 'dhtmlsql.php';

Or, if you use Composer:, (*5)

"require": {
   "dhtml/dhtmlsql": "^1.0"
}

Or just run composer require dhtml/dhtmlsql, (*6)

That's it, you can now use DHTMLSQL to run your queries:, (*7)

Requirements

PHP 5+ with the mysqli extension activated, MySQL 4.1.22+, (*8)

How to use

Connect to a database, (*9)

<?php
require "library/dhtmlsql.php";

// Connection data (server_address, name, password,  database)
$db=DHTMLSQL::connect('localhost','admin','pass','dbtest');
?>

A SELECT statement, (*10)

select(
    'column1, column2',
    'table',
    'criteria = ?',
    array($criteria)
);

// after this, one of the "fetch" methods can be run:

// to fetch all records to one associative array
$records = $db->fetch_assoc_all();

// or fetch records one by one, as associative arrays
while ($row = $db->fetch_assoc()) {
    // do stuff
}
?>

An INSERT statement, (*11)

insert(
    'table',
    array(
        'column1' => $value1,
        'column2' => $value2,
    )
);
?>

An UPDATE statement, (*12)

update(
    'table',
    array(
        'column1' => $value1,
        'column2' => $value2,
    ),
    'criteria = ?',
    array($criteria)
);

?>

Support

Visit the project page for documentation, configuration, and more advanced usage examples., (*13)

You can also read the complete API documentation here or even discuss it here., (*14)

Author

Anthony Ogundipe a.k.a dhtml, (*15)

Special thanks to Marcellinus Okeke and Oyebanji Jacob Mayowa for their contributions to this library., (*16)

License

Licensed under the MIT License, (*17)

The Versions

23/03 2016

dev-master

9999999-dev https://github.com/dhtml/dhtmlsql

An ultra-modern, advanced, compact and lightweight MySQL database wrapper library, built around PHP's MySQLi extension.

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

database php library wrapper mysql mysqli class db

17/01 2016

v0.1-alpha

0.1.0.0-alpha https://github.com/dhtml/dhtmlsql

An ultra-modern, advanced, compact and lightweight MySQL database wrapper library, built around PHP's MySQLi extension.

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

database php library wrapper mysql mysqli class db

17/01 2016

1.0

1.0.0.0 https://github.com/dhtml/dhtmlsql

An ultra-modern, advanced, compact and lightweight MySQL database wrapper library, built around PHP's MySQLi extension.

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

database php library wrapper mysql mysqli class db