have a bit of a problem..right now I have this script randomly displaying site names that have registered on my site...the problem is the initial page url and the one that is later verified are different not because I want to but because anytime I call the variable at a later time it will spit something else out....how can i resolve this? // Edit this number to however many links you want displaying $num_displayed = 1 ; // Select random rows from the database $result = mysql_query ("SELECT * FROM users ORDER BY RAND() LIMIT $num_displayed"); // For all the rows that you selected while ($row = mysql_fetch_array($result)) { // Display them to the screen... $dadum = $row["site"]; $datum = $row["id"]; PHP:
i cant understand what is the exact problem .. please be breif in what u say .. i am here to help php programmers
ok let me slow down a little bit...right now I am using a script that will display a site randomly using a variable like $dadum and check if it was stumbled...the problem is on the verification when I call $dadum at any other time it will change the site to a different random site so the verification will fail
That's rather the intent of a random function... to be random. If you want your script to remember what specific site was chosen at random the first time, use a session variable to store it.
yes, you need to store session variables to do this. ORDER BY RAND() clause will take random record every time the query is accessed.