Hi i wrongly posted in general section , and i was not able to solev this problem , if any one can help me please
Hi
i am using random 3 image display where i am picking stored URL in the database and adding them in the absolute path of image src . The main problem i am facing is that the number of images is less in number therefore
mt_rand() and rand() are not providing adeqaute randomization , can any one please tell me what another method can i use
i am including my code in here
include(\"user/database.inc\");
$link = dbconnect(\"localhost\" , \"root\" , \"jeetnahai\");
/ This section deals with eliminating al the ad registered
which don\'t have any view purchased or no views left/
$stmtad = \"select adname , viewpurchased , viewed from adview\";
$result3 = mysql_query($stmtad);
$effect = mysql_num_rows($result3);
for($i = 0; $i < $effect; ++$i) {
$adrow[$i] = mysql_fetch_row($result3);
if($adrow[$i][1] == 0 || ($adrow[$i][1] - $adrow[$i][2]) == 0) {
$adrow[$i] = 0;
}
else {
$adname[$i] = $adrow[$i][0];
}
}
//here we are selecting three images randomly from available images
$arradnum = count($adname);
for($i = 0; $i < 3; ++$i) {
$rnd = mt_rand(0 , $arradnum);
$adnames[$i] = $adname[$rnd];
echo($adnames[$i]);
echo($arradnum);
}
//display of the three images selected
for($i = 0; $i < 3; ++$i) {
$stmt = \"select image from addisplay where adname = \'$adnames[$i]\'\";
$result = mysql_query($stmt);
$row = mysql_fetch_row($result);
$pic[$i] = $row[0];
$stmt2 = \"select viewed from adview where adname = \'$adnames[$i]\'\";
$result2 = mysql_query($stmt2);
$row2 = mysql_fetch_row($result2);
$viewed[$i] = $row2[0];
$value = $viewed[$i] + 1;
$stmtin = \"update adview set viewed=\'$value\' where adname = \'$adnames[$i]\'\";
$resultin = mysql_query($stmtin);
}