PHP Classes
elePHPant
Icontem

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    
Last Updated Ratings Unique User Downloads Download Rankings
2013-01-11 (3 years ago) RSS 2.0 feedNot yet rated by the usersTotal: 449 All time: 5,876 This week: 1,081Up
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

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:449
This week:0
All time:5,876
This week:1,081Up