Db->select*() functions:
$arr = $db->select('select * from PERSONS where ID=1');
$arr = $db->select('PERSONS', 'ID=1');
$arr = $db->select('PERSONS', ['ID' => 1]);
$arr = $db->select('PERSONS:NAME,SURNAME', ['ID' => 1]);
Db->select*() functions with parameters:
$param = ['A' => 'test', 'B' => 4];
$arr = $db->select("select * from PERSONS where A='{A}' and B='{B}'", $param);
$arr = $db->select('PERSONS', ['A'=> 'test', 'B' => 4]);
$arr = $db->select("select * from PERSONS where A='{0}' and B='{1}'", ['test', 4]);
$arr = $db->select('PERSONS', "A='{0}' and B='{1}'", ['test', 4]);
$arr = $db->select("select * from PERSONS where A='{0}' and B={1}", 'test', 4);
$arr = $db->select("select * from PERSONS where CATEGORY in ('{LIST_OF_IDS}')", ['LIST_OF_IDS' => [1,2]]);
You can use hash mark in parameter to force integer conversion: {#A} - will be always integer.
Db->insert(), Db->delete():
$new_id = $db->insert('PERSONS', ['NAME' => 'John', 'SURNAME' => 'Rambo']);
$db->delete('PERSONS', ['ID' => $new_id]);
Db->update():
$data = ['NAME' => 'John', 'SURNAME' => 'Rambo'];
$db->update('PERSONS', $data, "ID='4'");
$db->update('PERSONS', $data, "ID='{0}'", 4);
$db->update('PERSONS', $data, ['ID' => 4]);
$db->update('PERSONS', 'MONEY=MONEY+1000', "ID='4'");