I'm still vary new to PHP coding.

I have the code to request and show numbers from my database but I cant seem to figure out how to show text. I've Googled it with different phrases but cant seam to figure it out.

I have the following code: As you can see the second statement is in number format and works great, but the first statement I need to change to show the username rather then the numbers.

So instead of it saying " . number\_format((float)$row['0']) . " it needs to say what? So it shows the username with the most tokens.

---

**Edit: I added notation to the original code I posted so it is easier to see what I did in my final code.**

---

```
/*Begin username search*/
$result = mysqli_query($con,"SELECT username FROM authorize WHERE MAX(tokens)");
/*End username search*/

/*Begin display of username*/
while($row = mysqli_fetch_array($result)) {
  echo "<tr>";
  echo "<td class='pslc'>" . number_format((float)$row['0']) . "</td>";
}
/*End display of username*/

/*Begin search of tokens for username*/
$result = mysqli_query($con,"SELECT MAX(tokens) FROM authorize");
/*End search of tokens for username*/

/*Begin display of tokens for username*/
while($row = mysqli_fetch_array($result)) {
  echo "<td class='psrc'>" . number_format((float)$row['0'], 5, '.', '') . "</td>";
  echo "</tr>";
}
/*End display of tokens for username*/

```

---

**Edit: Here is an update of my final code so others can see what I did.**

First I edited the " . number\_format((float)$row['0'], 5, '.', '') . " to say " . $row['0'] . " this change alone did not fix my problem.
So after much trial and error I discovered that I needed to make a code that would request the MAX(tokens). After requesting MAX(tokens) tell the next search to find a username related to the provided amount of tokens found. Then display the username and tokens on the page.

```
/*Begin username search*/
$result = mysqli_query($con,"SELECT MAX(tokens) FROM authorize");
while($row = mysqli_fetch_array($result)) {
$maxtokenusername=("SELECT username FROM authorize WHERE tokens = '" . $row['0'] . "'");
}
/*End username search*/

/*Begin display of username*/
$result = mysqli_query($con,$maxtokenusername);
while($row = mysqli_fetch_array($result)) {
  echo "<tr>";
  echo "<td class='pslc'><center>" . $row['0'] . "</center></td>";
}
/*End display of username*/

/*Begin search of tokens for username*/
$maxtokens=("SELECT MAX(tokens) FROM authorize");
/*End search of tokens for username*/

/*Begin display of tokens for username*/
$result = mysqli_query($con,$maxtokens);
while($row = mysqli_fetch_array($result)) {
  echo "<td class='psrc'>" . number_format((float)$row['0'], 5, '.', '') . "</td>";
  echo "</tr>";
}
/*End display of tokens for username*/

```