The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

MYSQL Update Random Row? Possible? by MikeCDN2005-05-04 12:53:17
  SELECT, then UPDATE by placidpsychosis 2005-05-04 13:25:44
Or, use a subselect of some sort. Problem with RAND() would be that it may fall outside the boundries of the id field, in which case UPDATE would fail. It's likely easiest to pull a COUNT(), get a random number from 1 to COUNT(), then UPDATE that row...
[ Reply ]
    Thanks by MikeCDN2005-05-04 13:44:48
    Only if there's no deleted rows! (n/t) by Arachnid2005-05-04 13:47:17

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)