More random RAND() in MYSQL
| From: | Graham Anderson | Date: | Fri, 30 Sep 2005 18:47:23 +0000 |
| Subject: | More random RAND() in MYSQL | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-40440@lists.php.net to get a copy of this message | ||
The ORDER BY RAND() function is not incredibly random
Is there some way to make RAND() a bit more spontaneous ?
$sql = "SELECT media.id,
artist.name as artist,
artist.spanish as bio,
artist.purchaseLink,
artist.picture,
media.spanish as trackName,
media.path,
media.quality,
mediaType.id as mediaType
FROM artist, media, playlistItems, mediaType
WHERE playlistItems.playlist_id = $myID
AND playlistItems.media_id = media.id
AND media.artist_id = artist.id
AND media.mediaType_id = mediaType.id
ORDER BY RAND() LIMIT 0, 30";many thanks g