Re: Random Quotes...
| From: | CPT John W. Holmes | Date: | Wed, 22 Oct 2003 15:47:29 +0000 |
| Subject: | Re: Random Quotes... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-167108@lists.php.net to get a copy of this message | ||
From: "Payne" <payne@magidesign.com>
> I am working on a project and I need to see sample quote for doing
> random quotes. These quotes will be put from a database. Can some please
> share me some sample code. Thanks.
If you're using MySQL, you can use
SELECT quote FROM Quote ORDER BY RAND() LIMIT 1
to pull a single random quote from the database.
I'm sure other databases have similar queries.
---John Holmes...