shouldnt the code be
<?
$result = mysql_query("SELECT * FROM `testtable` WHERE `v`='0' ORDER BY RAND() LIMIT 0,1");
while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
$test = $row{'num'};
}
echo $test;
?>
notice that i have changed
LIMIT 1
to
LIMIT 0,1
the first value in the limit decides where you want to start showing the results from the selected rows, the second decides how many you want to display.
so LIMIT 1 would start from the second row and show everything that the query returns.
where as LIMIT 0,1 would start from the first row and only show 1 record..
hth