Mysql: Random dice
Getting a random roll of the dice:
CREATE TABLE dice (
d\_id int(11) NOT NULL auto\_increment,
roll int,
PRIMARY KEY (d\_id)
);
insert into dice (roll) values (1);
insert into dice (roll) values (2);
insert into dice (roll) values (3);
insert into dice (roll) values (4);
insert into dice (roll) values (5);
insert into dice (roll) values (6);
select roll from dice order by rand() limit 1;