Hi.

I am trying to do a simple blog in PHP.

When a new post is created the user can chose to add multiple categories to it. Fine so far.

When the user wants to edit that same post I want to be able to select all the categories related to that post and select all the categories not related to that post except the ones already slected, so the user may be able to add or remove new/old categories.

The problem is that when I query that, I get those categories related to the post shown twice, because they are called from the related and the unrelated table.

Ie.
HOME, WORK, FREETIME, HOME

Where the last one should be shown, but not the first one. The user should not be able to select a category that is already selected.

I hope Im making sense here.

Thanks
Vayu