Hyperlinks within a table - '<a href="">'.$row['username'].'</a>'
- by Taimur
Hi,
I have made a leaderboard table on my site, which returns the users in the MySQL database with the highest scores (score is a separate field). The fields in the leaderboard table are 'rank' 'username' and 'score'. I would like to link each username in the table to it's own profile page.
The profile pages are in the format /profile.php?user=$username. How would I go about adding an <a href> within the table (which is echoed in php):
echo '<tr><td>' .$a. '</td><td><a href="profile.php?user=' .$row['username']. '">' .$row['username']. '</a></td><td>'.$row['count'].'</td></tr>';
I've tried the above, but it doesn't seem to work. It shows the usernames, but they don't have any hyperlinks.
Thanks