I think the problem you are having is really down to using the wrong approach for this.
Instead of storing the coma separated list of selected categories in the users table, you should be using a linking table
the structure of the tables would be something similar to:
userID - Primary Key
userName - text
categoryID - Primary Key
userCategoryID - primary key
userCategoryUserID - foreign key - relates to users.userID
userCategorycategoryID - foreign key - relates to categories.categoryID
your form would insert the user data to the users table, Then for each selection made in the categories list, would create a new record in the linking table. using the mysql_insert_id() function on the user table insert to return the ID of the newly created user record for the userCategoryUserID column and the value from the select list for the userCategorycategoryID column.