Simpler way is to use excel or a similar program to make a query for you. You can sort by reagent ID in navicat, and copy-paste it into excel. Something like
Code:
"Select * from items where id = (id from navicat) and
id = | (next id from navicat) | and"
with the | being a delimiter for the cell. Then, you can copy-paste into navicat, run the query, and use navicat's export tools to export all of the item IDs that are used by the spells table, and then empty the table (also using navicat) and import the SQL you also exported. Try that, see if it works.
If all else fails look into JOIN queries.
Protip: Navicat's ordering views + Excel = heaven.