echo "<tr><td>{$r['logID']}</td><td><a href='viewuser.php?u={$r['>{$r['username']}</a> [{$r['userID']}]</td><td>{$r['amount']}</td><td><a href='5050.php?chal={$r['>Challenge</a></td><td>";
You have "$r[" in the middle of double quotes. Escape it with a slash and you'll be better off (PHP is trying to evaluate your variable). You probably don't mean to have $r, but just r
echo "<tr><td>{$r['logID']}</td><td><a href='viewuser.php?u={\$r['>{$r['username']}</a> [{$r['userID']}]</td><td>{$r['amount']}</td><td><a href='5050.php?chal={$r['>Challenge</a></td><td>";
I personally think your syntax is confusing, I'd rather use "." to concatenate the strings and variables:
echo ' <tr><td>'
. $r['logID']
. '</td><td>'
. '<a href="viewuser.php?u=r[' . $r['username'] .']">'.$r['username'].'</a>'
. '['.$r['userID'].']</td><td>'
. $r['amount'] . '</td><td>'
. '<a href="5050.php?chal=r">Challenge</a></td><td>';