In my attempt to learn perl and make it do what I want. I am attempting to
convert some php code a friend of mine did a while back. Unfortunately,
with my knowledge of perl and php, this is a little over my head. If
anyone could look at the following code and tell me how to make it work in
perl, I would appreciate it. Unfortunately, my friend is not available, so
I can't bug him.
Thanks
Chris
ps....Thanks for the help earlier Casey. That did it.
$sql = mysql_query("Select id, trueodds, oneinodds, prize, picture from
scratch_odds where trueodds = '0' and howmany > '0'") or die(mysql_error());
$count = MYSQL_NUMROWS($sql); # just gives the number of rows returned.
$result = mysql_fetch_array($sql); # assigns the sql result into an array
do{
$tmp = rand($countresult[0], $countresult[1]); // Gives us random
numbers between low and high in odds table.
}while($tmp == $result[0]);
$rand[] = $tmp;
for($count = 1; $count < 3; $count++ ) // loops 3 times.
{
do{
$tmp = rand($countresult[0], $countresult[1]);
}while(in_array($tmp, $rand) || ($tmp == $result[0]));
$rand[] = $tmp;
}
$rand[] = $result[0]; # array 1
$rand[] = $result[0]; # array 2
$rand[] = $result[0]; # array 3
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]