PT Português
Versão: v2.3.0

get

Recuperar um único registro de uma tabela.

get($table, $columns, $where)
get($table, $join, $columns, $where)
Valor de retorno
[mixed] O primeiro registro correspondente como um valor escalar ou array associativo.
$email = $database->get("account", "email", [
	"user_id" => 1234
]);

// Resultado de exemplo:
// "foo@bar.com"

$profile = $database->get("account", [
	"email",
	"gender",
	"location"
], [
	"user_id" => 1234
]);

// Resultado de exemplo:
// array(
// 	"email" => "foo@bar.com",
// 	"gender" => "female",
// 	"location" => "earth"
// )

$data = $database->get("post", [
	"[>]account" => "user_id"
], [
	"post.content",
	"account.user_name",
	"account.location"
], [
	"ORDER" => "post.rate"
]);

// Resultado de exemplo:
// array(
// 	"content" => "A new day",
// 	"user_name" => "foo",
// 	"location" => "earth"
// )