php run function returned by mssql query
Posted on 2012-09-21
i am working on a way to do callback function in my code. i have a webpage that adds or changes records in my database, some of these changes require other changes to happen after, some dont, and some require something else to happen.
the database is to track training for employees, i have a table of training for employees and as well as a table of all the different training we do. i would like to be able to store a php function in the second table in a nvarchar(max) so that each training can have its own callback. when the php changes/adds training, it would query the second table to see if it has a callback, pull it down and execute it.
the problem i am having is that i dont know how to execute this function after i pull it down. it would be stored in a php string variable and im not sure how to execute it. i have read about eval() function but i dont like using it. i was wondering if there is a way of doing this.