Put Methods

Persist or remove data using these methods.

$db = new Dba();

table( string $name | array )

Set the name of the table to query.

$db->table('users');

Include a table alias using an array.

$db->table(['u' => 'users']);

set( array $columns )

Define the columns and values to insert() or update().

$db->set(['firstName' => 'Bill']);

where( array $conditions )

Define the conditions for the queries update() and delete().


insert()

Insert an entry into the database.

$user = $db->set(['firstName' => 'Trevor', 'lastName' => 'Smith'])->insert();
Query
INSERT INTO users SET firstName='Trevor', lastName='Smith';

Method alias: create()

replace()

update()

updateById()

delete()

Last updated