yeah that looks like the new method im using
- Code: Select all
$result = mysql_query("SELECT count(*) FROM slinks where approval='1'");
$do = mysql_fetch_row($result);
$rand = mt_rand(0,$do[0] - 1);
$result = mysql_query("SELECT * FROM slinks LIMIT $rand, 1");
yeah this code is on a personal script in coding i have another question you may be able shed a light on..
the code im running is
- Code: Select all
$result = mysql_query("SELECT count(*) FROM slinks where approval='1'");
$do = mysql_fetch_row($result);
$random = mt_rand(0,$do[0] - 1);
$result = mysql_query("SELECT * FROM slinks LIMIT $random, 1");
The above is finished off into a iframe
- Code: Select all
<iframe src="<?php while ($row = mysql_fetch_array($result)){ print $row["url"];}?> "frameborder="0" width="100%" height="100%" name="surfing"id="dframe"></iframe>
resulting in a random site loaded ever time the php file is ran
now all i need to figure out with a little help is how i can get the random site to only be ran one time per user.
example
click = randomsite1.com
click = randomsite2.com
click = randomsite3.com
click = randomsite4.com
click = randomsite5.com
click = randomsite5.com = <--SKIP done been called so lets move along
click = randomsite6.com
I guess somehow im going to have to store the urls that are loaded into a variable and compare the variable to the the random site to make sure we dont get a match.
then again i guess i would have to some how figure out how to store the data per unique user as well .
Any suggestions would be greatly appreciated