Turned $mapply_db_version to a constant.

It does not change during the execution of the program, so constant fits nicer than variable for me. Constants are "global", thus available in any context, and they are nice because they can not be changed, avoiding many of the problems of global variables.

The way it was implemented had a bug, in that $mapply_db_version "does not exist" inside the mapply_install() function.

You might expect that you would declare a variable as global and then it is available inside all functions, but that's not the case in PHP. Instead, you use the `global` keyword to pull a variable from the global scope into a function's scope on a function-by-function basis, like you did with $wpdb.