door/rdb

Relations database connector for Door framework

dev-master 2015-08-02 21:29 UTC

This package is not auto-updated.

Last update: 2024-11-19 01:51:32 UTC


README

Fork of kohana/database module. Maked it for using standalone.

Usage example:

//creating connection
$database = new Door\RDB\Database\MySQL(array(
	'connection' => array(
		'hostname'   => 'localhost',
		'database'   => 'databasename',
		'username'   => 'username',
		'password'   => 'password',
		'persistent' => FALSE,
	),
	'table_prefix' => '',
	'charset'      => 'utf8',
	'caching'      => FALSE,
));

//performing queries
$database->list_tables();
$database->list_columns('users');
$database->query(Door\RDB\Database::SELECT, "select * from roles")
	->execute()
	->as_array();
$database->select("id,name,email")
	->from('users')
	->where('registered',">","2014-01-01")
	->execute()
	->as_array();
$database->delete('users')->where('id', '=', 25)->execute();