A modest collection of PHP libraries used at SparkFun.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
289 B

  1. <?php
  2. namespace SparkLib\DB;
  3. class Random implements Literal {
  4. public function __construct ($db_type = 'mysql')
  5. {
  6. $this->_dbType = $db_type;
  7. }
  8. public function literal ()
  9. {
  10. if ('mysql' === $this->_dbType)
  11. return 'RAND()';
  12. else
  13. return 'RANDOM()';
  14. }
  15. }