Skip to content

Latest commit

 

History

History
37 lines (28 loc) · 959 Bytes

README.md

File metadata and controls

37 lines (28 loc) · 959 Bytes

Roka\DML

Build Status

MySQL DML in PHP. For fun.

$select = Select::fields('count(*)');
$select->from('users');

$select = Select::fields('name');
$select->from('users');
$select->orderBy('length(name) DESC');
$select->limit(10);
$select->page(12);

$select = Select::fields('name');
$select->from('users');
$select->orderBy('length(name) DESC');
$select->limit(10);
$select->page(12);

$select = Select::fields('foo, bar');
$select = Select::fields(['foo, bar']);
$select = Select::fields('foo', 'bar');
$select = Select::fields(['foo', 'bar']);

$select = Select::fields('name');
$select->from('users AS u');
$select->join('posts AS p ON p.created_by = u.user_id');
$select->leftJoin('comments AS c ON c.post_id = p.post_id');

print $select->getJoin('p');
print $select->getJoin('c');

print $select->getSQL();