[PHP] Random Quotes...

2003-10-22 Thread Payne
Hi,

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.

Chuck

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


Re: [PHP] Random Quotes...

2003-10-22 Thread Tom Rogers
Hi,

Thursday, October 23, 2003, 1:34:02 AM, you wrote:
P Hi,

P I am working on a project and I need to see sample quote for doing 
P random quotes. These quotes will be put from a database. Can some please 
P share me some sample code. Thanks.

P Chuck


If you are using mysql have a look at 'order by random' and limit

-- 
regards,
Tom

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



Re: [PHP] Random Quotes...

2003-10-22 Thread CPT John W. Holmes
From: Payne [EMAIL PROTECTED]
 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...

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