database randomness

    Date: 10/11/05 (PHP Community)    Keywords: php, database

    I had posted a while ago (I can't even remember if it was the php community) on the best way to pick a random item out of a database. The code I was given was "ORDER BY rand() LIMIT 1", except this is not random - the percentage of times the first item is taken out of the database is very high. Does anybody have a better way?

    Source: http://www.livejournal.com/community/php/353721.html

« include problem || sorting archives by month »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home