Get Started

Upgrade

Where Syntax

Query

Aggregation

Fetch

Transaction

Management

Advanced

Raw object

PDO object

Debug

Information

version: 2.2.0

rand

Fetch data from the table randomly.

rand($table, $column, $where)
rand($table, $join, $column, $where)
Return: [array] Random data from the table.
  1. $data = $database->rand("account", [
  2. "user_name",
  3. "email"
  4. ], [
  5. "user_id[>]" => 100
  6. ]);
  7.  
  8. // $data = array(
  9. // [0] => array(
  10. // "user_name" => "foo",
  11. // "email" => "foo@medoo.in"
  12. // ),
  13. // [1] => array(
  14. // "user_name" => "cat",
  15. // "email" => "cat@medoo.in"
  16. // )
  17. // )