you set up two tables:
first your existing table: 'table1'
eliminate the categories column and put in an ID column (call it 'id')
second table: 'categories'
columns: table_id, table1_id, category
these tables have a one-to-many relationship: each entry in table1 will have many entries in the categories table. So, instead of storing your related categories in a column in comma separated list (1,4,6) you have three rows in the categories table - one for each related category.
then you can pull out rows from both like so:
"select table1.* from table1 left join categories on table1.id=categories.table1_id where categories.category=4" (or whatever category you want).
read this: http://www.phpbuilder.com/columns/barry20000731.php3
it will help.