var func = new Function(theFunctionString);
func();
MDN:
new Function ([arg1[, arg2[, ... argN]],] functionBody)
Parameters
arg1, arg2, ... argN
Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript identifier or a list of such strings separated with a comma; for example "x", "theValue", or "a,b".
functionBody
A string containing the JavaScript statements comprising the function definition.
Update:
All this a very bad practice!
You should have a generic function that get parameters that build what you want. The only thing that change are the parameters. Store those parameters in the DB you have.
eval()to execute Javascript in a string, but this is normally considered a Very Bad Practice. It isn't making sense to me why you would want to store JQuery event functions in a MySql table. Maybe you should rethink what you are trying to do.eval.