iautomation/dynamic-query

Dynamic SQL query access class for php; shortcuts to do advanced queries; uses Pixie

dev-master 2015-10-03 16:06 UTC

This package is not auto-updated.

Last update: 2021-02-23 16:36:01 UTC


README

Dynamic SQL query access class for php; shortcuts to do advanced queries; uses Pixie

Methods

Coming soon; see class

Example Usage

$db = new \DynamicQuery\DynamicQuery('mysql', 'test', 'localhost', 'root', '');
$db->query('
CREATE TABLE test
(
id int NOT NULL AUTO_INCREMENT,
name           text      NOT NULL,
age            int       NOT NULL,
address        varchar(50)
PRIMARY KEY (id)
)');
$rows = $db->test->insert([
	'name'=>'last',
	'age'=>'12',
	'address'=>'123 test'
]);
$rows = $db->test->findAllDynamic('age', 12);
$rows[0]->address = 'asdfasdfasdfasdfasdf11111111111111';
$rows[0]([
	'address'=>'12o3592532354235'
]);
$rows[0]->save();
print_r($db->test->findAll('age', 12));