版本: v2.3.0
get
किसी तालिका से एकल रिकॉर्ड प्राप्त करें.
get($table, $columns, $where)
table [string]
क्वेरी करने के लिए तालिका का नाम.
columns [string/array]
प्राप्त किए जाने वाले कॉलम.
where [array] (वैकल्पिक)
WHERE क्लॉज़ का उपयोग परिणाम सेट को फ़िल्टर करने के लिए किया जाता है।
get($table, $join, $columns, $where)
table [string]
क्वेरी करने के लिए तालिका का नाम.
join [array]
संबंधित तालिकाओं को जोड़ने के लिए उपयोग की जाने वाली JOIN परिभाषाएँ। यदि JOIN की आवश्यकता न हो, तो इस पैरामीटर को छोड़ा जा सकता है।
columns [string/array]
प्राप्त किए जाने वाले कॉलम.
where [array] (वैकल्पिक)
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"
// )