Bitsys, you may be able to help me. I'm trying to display the richest user's username and amount of points they have on my forum home page.
So far, I've gotten it to display a username and the amount of points they have on hand, but it's not showing the richest user.
Here's the code:
PHP Code:
$mostpoints=$DB_site->query_first("SELECT userid,field5 FROM userfield ORDER BY field5 DESC LIMIT 1");
$richest=$mostpoints[userid];
$richuser=$DB_site->query_first("SELECT userid,username FROM user WHERE userid=$richest");
$richestuser=$richuser[username];
Again, it displays a username and their matching amount of points they have on hand, but they are not the richest, nor the poorest either.
Any hints?