Jump to content

Random records


hoponhiggo

Recommended Posts

Hi All

 

I am using the below code to display users registered on my site:

 

<div class="profilbox" id="apDiv11"><div></div>
<div align="center">Registered Users</div>
<div class="text_area"><?php

//to display image from source - registerd users
$dir = "profpics";

echo '<table>';
$result = mysql_query("SELECT * FROM users order by id");
while ($row = mysql_fetch_assoc($result)) {
    echo "<tr><td><img src=\"$dir/{$row['prof_pic']}\" width='40' height='40'>{$row['username']}</td></tr>";
}
//close out table
echo '</table>';
?></div>

</div>

 

Could anybody tell me how i can limit this to 3 random results? I then plan adding a link to 'see all'

Link to comment
https://forums.phpfreaks.com/topic/236242-random-records/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.