Medoo

开始

更新日志

Where 语句

查询

聚合

Fetch

事务

原生SQL查询

Raw object

PDO object

Debug

数据库信息

get

从表中返回一行数据

get($table, $columns, $where)
get($table, $join, $columns, $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"
// )

$data = $database->get("post", [
	"[>]account" => "user_id"
], [
	"post.content",
	"account.user_name",
	"account.location"
], [
	"ORDER" => "post.rate"
]);

// $data = array(
// 	"content" => "A new day",
// 	"user_name" => "foo",
// 	"location" => "earth"
// )