Use only one query:
SELECT
category,
item,
...
ORDER BY category, item
Now fetch rows, and keep the latest categoryID in a flag variable:
- if fetched categoryID flag, close table, create a new table, add header
row
- otherwise add content row to the current table
- update flag with the latest
Rene,
This is a clarification of what I think Ignatius was talking about.
I did like this on www.deep-purple.com/tourdates:
Your database structure must look something like this for it to work:
ID ITEMCATEGORY
1 1 1
2 2 1
3 3