Then your database is structrued wrong.
http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html
You need three tables, one for categories, one for items, and one to match categories to item.
table categories_items (two fields)
catID | itemID
for one thing, what if you want an item to be in more than one category? For another, you never repeat data in a table if you can at all help it (such as category id, it’s repeated for every item with that category) because it messes with the indexing.
Then you just use joins.
http://www.keithjbrown.co.uk/vworks/mysql/mysql_p5.shtml
http://hackmysql.com/case4
There are those here better at that than I am, I have to really focus down hard and spend hours figuring out the joins, but it’s really not that hard once you get the "hang" of it. I’m numerically dyslexic; I see numbers reversed, still after over four years can’t remember my phone number, and have trouble with spatial patterns (I’ve never parallel parked in my life, and can’t for the life of me solve those stupid little puzzles with the randomized squares you have to move around into their proper places.) So I figure that if I can do it with some hard work, it shouldn’t be so difficult for anybody else to learn.