How about rand() on your ID column.

http://www.php.net/manual/en/function.rand.php


>>How's that for alliteration in a subject line?
>>
>>Got a simple MySQL table that contains records which are made up of only
>>three fields - ID, quote and author. These are "inspirational" quotes that
>>I want to appear at the bottom of the pages of my website. I want them to
>>come up randomly with every page load. I've posted this on a MySQL board to
>>see if there's a MySQL command to make things simple. But, I thought about
>>building a random number generator in PHP that selects a random number out
>>of the total number of records in the table, saves it into a variable and
>>then have MySQL retrieve that ID. Is this the way to go or is there
>>something simpler. And, if this is the best way to go, unfortunately I
>>don't know how to write a random number generator in PHP so would
>>appreciate any help.
>>
>>Thanx in advance,
>>Robb
         

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to