You are here

public function DatabaseConnection_sqlite::sqlFunctionRand in Drupal 7

SQLite compatibility implementation for the RAND() SQL function.

File

includes/database/sqlite/database.inc, line 231
Database interface code for SQLite embedded database engine.

Class

DatabaseConnection_sqlite
Specific SQLite implementation of DatabaseConnection.

Code

public function sqlFunctionRand($seed = NULL) {
  if (isset($seed)) {
    mt_srand($seed);
  }
  return mt_rand() / mt_getrandmax();
}