Bro it just might be me. But you will have to change a little to use my stuff. It wouldn't be much harder though.
You have:
$result2 = mysql_query("SELECT DISTINCT username FROM useronline WHERE
username!='' ORDER BY timestamp desc");
while($r=mysql_fetch_array($result2))
{
$username=$r["username"];
$place=$r["file"];
print "<tr><td><a href=\"index.php?profile=$username\">$username</a></td><td>$place</td></tr>";
}
While don't you just simply take the user_id? Make an auto_increment field so you can call it by a distinct number instead of doing it your way? If you got a ton of stuff there now then just wait till morning for someone to answer. Here is what I would do...
$result2 = mysql_query("SELECT * FROM useronline WHERE
username='value' ORDER BY timestamp desc");
while($r=mysql_fetch_array($result2))
{
$username=$r["username"];
$place=$r["file"];
print "<tr><td><a href=\"index.php?profile=$username\">$username</a></td><td>$place</td></tr>";
}
That will find everything that the username has done, and order it by timestamp and make it descend. That is just easier in my mind. If you do that then all will be good. I think atleast. Its just me though.
Ziggs