$users = mysql_result(mysql_query(SELECT COUNT(*) FROM `users`),0); $tot = $users / 100 * 5; for ($i = 0; $i < $tot; $i++) { $row = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` ORDER BY RAND() LIMIT 1")); echo $row['поле'].'<br/>'; }