Question: I am trying to display all the user\_name from my sql

[![My sql stuff](https://i.stack.imgur.com/bvhvk.png)](https://i.stack.imgur.com/bvhvk.png)

how can i make all the user\_name show up with line breaks after each name?"

my code

```
<?php
include_once 'dbconnect.php';
$res = mysql_query("SELECT 'user_name' FROM `users`");
$row = mysql_fetch_array($res);
echo $row;
?>

```

when i load the page nothing shows up

Answer: 
This should be all over the internet. A simple google search is all.

```
SELECT user_name FROM users;

```

Make sure you have a connection first:

```
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
} 

```
Usually when nothing is shown, this has to do with a false being printed out as nothing. Can you changing echo $row to echo "something awesome: ".$row;. If you see the "something awesome: " then you know your query doesn't return anything.

Second of all, you **don't iterate** thought your results, you just echo one row of the "oh so many".

This can be fixed using a while loop like this:

```
$result = mysql_query("SELECT user_name FROM users");

while ($row = mysql_fetch_array($result)) {
  echo $result['user_name'];
}

```

This will go through each record and echo the username of the users.

Best regards,