0

I am trying to create a mysql event that updates all rows with a random string every month. The string doesn't have to be unique.

CREATE EVENT IF NOT EXISTS `new code`
ON SCHEDULE EVERY '1' MONTH
??
UPDATE table
SET code = "rand(?)"

I have no idea how to do the rest!

prince888
  • 63
  • 8

1 Answers1

1

Try using the MD5 function to convert a random number into a string:

SET code = MD5(RAND())
Chuck
  • 4,662
  • 2
  • 33
  • 55