Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

rand mysql

1
2
3
4
5
SELECT f.id FROM files f
      JOIN ( SELECT RAND() * (SELECT MAX(id) FROM files) AS max_id ) AS m
      WHERE f.id >= m.max_id
      ORDER BY f.id ASC
      LIMIT 1;
Source by www.kobzarev.com #
 
PREVIOUS NEXT
Tagged: #rand #mysql
ADD COMMENT
Topic
Name
9+4 =