JA 日本語
バージョン: v2.3.0

get

テーブルから単一のレコードを取得します。

get($table, $columns, $where)
get($table, $join, $columns, $where)
戻り値
[mixed] 最初に一致したレコード。戻り値はスカラー値または連想配列です。
$email = $database->get("account", "email", [
	"user_id" => 1234
]);

// 結果例:
// "foo@bar.com"

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

// 結果例:
// 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"
]);

// 結果例:
// array(
// 	"content" => "A new day",
// 	"user_name" => "foo",
// 	"location" => "earth"
// )