버전: v2.6.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"
// )