We can attach certain keywords to the SELECT statement, to output different types of results.
For example, we can use the DISTINCT Keyword, to output only unique values from specified columns in a table.
This keyword eliminates any duplicate records that would normally have been outputted with a basic select statement.
To use the DISTINCT Keyword, just replace your existing SQL statement with this line:
SELECT DISTINCT firstname FROM users;
We will need to edit our echo statement as well, so it only includes the first name.
Replace your existing echo statement with this one:
echo "Name: " . $row["firstname"]. "<br>";