Code:
SELECT id, name, cost, sellrate FROM items WHERE cost=0 OR sellrate=0;
The items you are speaking of should show up in the list, and you can fix the offending value. I am not sure if there may be somewhere else to look, so this is not guarenteed to work...but is a good place to start
Edit: You should only change the values for items on a merchant, as I also believe these values keep some items from being sellable (quest items, etc).