I've got a shop where users can purchase virtual items, such as one time power-up's and permanent changes to the users account. These purchases potentially alter different fields in different tables, and there's the possibility for a lot of items so i don't want to code a new addition to a PHP file every time i want to add a new product.
I'm thinking of saving the query as a string into a MySQL database, then when an item is purchased i can fetch the string from the database and run it like that.
For example: A table items
would contain a field query_to_run
which would contain the string UPDATE power_ups SET test = test WHERE test = 1
to be run when a user purchases an item.
Is this ever used or is there a better way to do this?