NYCPHP Meetup

NYPHP.org

[nycphp-talk] Random record from MySQL

Philipp Stader nyphp at ph1l.de
Thu Mar 11 10:45:24 EST 2004


 > -----Original Message-----
> From: talk-bounces at lists.nyphp.org 
> [mailto:talk-bounces at lists.nyphp.org] On Behalf Of tom at supertom.com
> Sent: Thursday, March 11, 2004 4:35 PM
> To: NYPHP Talk
> Subject: RE: [nycphp-talk] Random record from MySQL
> 
> Jeff,
> 
> Try:
> 
> SELECT  * FROM table_name ORDER  BY RAND(  ) LIMIT 0 , 1
> 
> Tom
> www.liphp.org
>  
Ha! I didn't know rand() yet. The use here is very interesting. I'll try
this one my own when i have need for some randomness again.

Phil

  
>  
>  
> ***************************************************
> What's Tom listening to right now?  Find out here:
> http://www.supertom.com/current_track.php
> 
> 
> 
> 
> -----Original Message-----
> From: talk-bounces at lists.nyphp.org
> [mailto:talk-bounces at lists.nyphp.org]On Behalf Of Jeff Siegel
> Sent: Thursday, March 11, 2004 10:32 AM
> To: NYPHP Talk
> Subject: [nycphp-talk] Random record from MySQL
> 
> 
> How can I pull a record at random from a MySQL table?
> 
> Jeff Siegel
> 
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
> 
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
> 
> 




More information about the talk mailing list