VI Tiếng Việt
Phiên bản: v2.3.0

rand

Lấy ngẫu nhiên một tập bản ghi từ bảng.

rand($table, $columns, $where)
rand($table, $join, $columns, $where)
Giá trị trả về
[array] Mảng kết quả theo thứ tự ngẫu nhiên.
$data = $database->rand("account", [
	"user_name",
	"email"
], [
	"user_id[>]" => 100
]);

// Kết quả ví dụ:
// array(
// 	[0] => array(
// 		"user_name" => "foo",
// 		"email" => "foo@medoo.in"
// 	),
// 	[1] => array(
// 		"user_name" => "cat",
// 		"email" => "cat@medoo.in"
// 	)
// )