PHP Classes

Minimalistic DB: Database abstraction layer with minimal interface

Recommend this page to a friend!
  Info   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 453 All time: 6,149 This week: 571Up
Version License PHP version Categories
minimalistic-db 2.0GNU General Publi...5PHP 5, Databases
Description 

Author

This package is a database abstraction layer with minimal interface.

It provides a factory class that can instantiate driver classes based on a given configuration to access a database.

The driver classes can:

- Connect to a database
- Set connection encoding,
- Escape literal text values
- Execute queries and return query results in arrays
- Return the fields of a result set
- Return the number of rows in a result or the number of affected rows
- Return the last inserted record identifier

Currently it provides a driver class to access MySQL databases using the MySQLi interface.

Picture of ZLioxygon
Name: ZLioxygon <contact>
Classes: 2 packages by
Country: Moldova Moldova
Age: 39
All time rank: 26664 in Moldova Moldova
Week rank: 411 Up1 in Moldova Moldova Up

Details

Minimalistic class for work with DB through factory-function. Simple use. Short name of methods. Main: object db(null|array|string) - factory-function accept: array JSON-encoded string path to file (JSON-encoded) NULL if used 'db_config' TRUE (or resend options) reconnect to DB return: object instance Methods: bool function o() - status connection bool|array q(string) - request to DB return: array - [data] TRUE - Ok FALSE - throw Exception string function s(string) - safe input data (real escape string) bool function c(string) - choice of encoding (collate) int function f() - return number of fields in result from last query (SELECT) int function r() - return number of rows in result from last query (SELECT) or affected records (INSERT, UPDATE, DELETE) int function l() - return last insert id int function i() - return counter (number of queries) int function t() - return timer (total work time)

  Files folder image Files  
File Role Description
Files folder imageclasses (2 files)
Accessible without login Plain text file db.php Class Main PHP file
Accessible without login Plain text file db_config.json Data DB config JSON-encoded file
Accessible without login Plain text file examples.php Example Examples
Accessible without login Plain text file readme.txt Doc. Readme

  Files folder image Files  /  classes  
File Role Description
  Accessible without login Plain text file db_config.class.php Class DB connect configuration
  Accessible without login Plain text file db_mysql.class.php Class Extended class

 Version Control Unique User Downloads Download Rankings  
 0%
Total:453
This week:0
All time:6,149
This week:571Up