i have a scrip that store members url in my database? i need to grab a random " username " from the database each time the page refreshes ? if possible i also need to grab the corresponding members link from the databse please help me? its quite urgent please. The database structure is very simple.
$query = mysql_query("SELECT username, link FROM db ORDER BY RAND() LIMIT 1"); while ($row = mysql_fetch_array($query)) { echo $row['username'] . " - " . $row['link']; } PHP:
if you mean this one echo $row['username'] . " - " . $row['link']; Code (markup): Then that code display the content of the username field inside your table and the link field. example output... vic_msn - http://www.siteurl.com/link.html
according to my need i changed it as follows <?php $querry = mysql_query("SELECT * FROM rotate_usr ORDER BY RAND() "); $roww = mysql_fetch_array($querry); ?> PHP: thank its working
there was already a $query and $row in the file so just like that. one more thing it (username) changes after two try's if i hit the refresh button but i changes to next value immediately when i type the url in the addressbar and hit the GO button