Hi 
I dont know exactly why u need this but this can be done in MySQL/PERL

create a file called random.pl 
i select a random reecord from Temp table with PK temp_id

#! /usr/bin/perl -w

use Mysql;
$i   = (10*rand())%10;

$dbh = Mysql->Connect('localhost','DBNAME','root');

$sth = $dbh->Query("Select * from Temp");
$no  = $dbh->Query("Select COUNT(temp_id) from Temp");
@nr  = $sth->FetchRow;

for($n=0; $n<@nr[0]; $n++)
{
        @row = $sth->FetchRow;
        if($n == $i)
        {
                print @row;
        }
}



On Tue, 6 Feb 2001, Culley Harrelson wrote:

> Any suggestions on how to select a random record from
> any given table?
> 
> Culley
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - Buy the things you want at great prices.
> http://auctions.yahoo.com/
> 

Reply via email to