get
從表中返回一行數據
get($table, $columns, $where)
table [string]
表名.
columns [string/array]
返回的字段列.
where (optional) [array]
WHERE 條件.
Return: [string/array] 返回查詢到的數據.
這個方法只能獲取一條數據
$email = $database->get("account", "email", [
"user_id" => 1234
]);
// $email = "foo@bar.com"
$profile = $database->get("account", [
"email",
"gender",
"location"
], [
"user_id" => 1234
]);
// $profile = array(
// "email" => "foo@bar.com",
// "gender" => "female",
// "location" => "earth"
// )