I have a database table that can collect urls from my friends. As the user, you can create a "folder or category(ie column)" and thereafter put your links there.

For example, if you wanted to create a column called "GAMES" and put your `www.ign.com` link in it, you could. This way you can organize.

When its time to display the content to the user, i want to be able to show the column name AND all the column values.

Ive been using this which works (kinda):

```
$callDbData = "SELECT * FROM $users_table ";
$callDbDataDoIt = mysqli_query($c2d, $callDbData) or die ("could not pull data" . mysqli_error($c2d));

while($row = mysqli_fetch_assoc($callDbDataDoIt)){ 
    foreach ($row as $fieldName => $value) { 
        echo "the field name is: <strong>" . $fieldName . "</strong> and the value is: " .$value.'<br />';
    }  
}

```

But the issue is that, since the column names are dynamic (to be created by the user as they see fit), i cant select it and place it with HTML/CSS directly which is why i made my SELECT statement like i did above: `$callDbData = "SELECT * FROM $users_table ";`

Also, each user will have their own column count.

**\* --------- EDIT ----------\***

Based on the above, and because the table column names are all dynamic, i cant call to them by name to organize them. I need a general way to call each column and their values. Essentially printing them One column & all values at a time.

As an example, currently i have a table on the db called "userTBL". This table is unique to the newly registered user. Inside of it I have 3 columns (also dynamically created) called 

---

```
-unsorted links
-magazines
-news

```

---

Each column on the db has URLS inside them, as an example:

**EXAMPLE ONE:** //THIS IS HOW THE VALUES ARE ON THE DB

```
-UNSORTED LINKS (column name)
url1 (value)
url2 (value)
url3 (value)

-MAGAZINES(column name)
url1 (value)
url2 (value)
url3 (value)
url4 (value)
url5 (value)
url6 (value)

-GAMES(column name)
url1 (value)
url2 (value)

```

So how its shown above, is exactly how it should be on the page when loaded on the front end because essentially, this will fill out a vertical menu. I need it to go to column 1, print the column name and all its values. Then move onto column 2 etc...

With the code (*shown above the "edit" line*) that i have currently to bring out the results, it comes out like this:

**EXAMPLE TWO**

```
-UNSORTED LINKS (column name)
url1 (value)

-MAGAZINES (column name)
url1 (value)

-GAMES (column name)
url1 (value)

-UNSORTED LINKS (column name)
url2 (value)

-MAGAZINES (column name)
url2 (value)

-GAMES (column name)
url2 (value)

-UNSORTED LINKS (column name)
url3 (value)

-MAGAZINES (column name)
url3 (value)

-GAMES (column name)
  url3 (value)

```

Any ideas how i can achieve the results like in EXAMPLE ONE?
**Thank you** in advanced for any help.