I’m making standard profile pictures for 5000 users, and right now i need to insert a referance in the ‘users’ table. I don’t want all the users to have the same standard profile picture, so i’m trying to update the ‘user_profile_image’ row with one of the strings listen in the query below.
UPDATE users
SET user_profile_image = rand('adrian.jpg', 'bendix.jpg',
hr_skaeg.jpg', `'jeppe.jpg')
The query doesn’t seem to work.
Is this way too simple?
Any help is much appreciated!
Kind regards,
Mathias
RAND()returns a number between 0 and 1; if you multiply it by the number of pictures you have and take theFLOOR(), you can switch on the result withELT: