TH ไทย
เวอร์ชัน: v2.3.0

get

ดึงข้อมูลระเบียนเดียวจากตาราง

get($table, $columns, $where)
get($table, $join, $columns, $where)
ค่าที่ส่งกลับ
[mixed] ข้อมูลรายการแรกที่ตรงกัน โดยอาจเป็นค่าสเกลาร์หรือ associative array
$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"
// )