You could append the table with a 'folder' column which contains a unique folder number. You then make another table, called 'folders' and you fill it like this:
+----+------------------------------+
| id | foldername |
+----+------------------------------+
| 1 | MyFirstFolder |
| 2 | MySecondFolder |
+----+------------------------------+
And so on. At the top of each of your pages, you define a $folder variable like this:
$folder = 2; // Put the number from the table here
After that, use a SQL query to get the correct folders like this:
SELECT link,linkname FROM my_table_with_links WHERE folder=$folder;
Hope this helps.
Greetz,
Vincent Driessen
Venlo, The Netherlands