Saving everything to MySQL, well the easiest way is to use the API to talk to an LMS. This also gives you a tier of content security plus a shed load of extra functionality.
Failing that you'd need to use a few extras like JS and PHP, although you could also use JS.
So you need an external JS script that has the main functions or a PHP page. Then you'd call the functions from within your module using JS.
Saving everything to MySQL, well the easiest way is to use the API to talk to an LMS. This also gives you a tier of content security plus a shed load of extra functionality.
Failing that you'd need to use a few extras like JS and PHP, although you could also use JS.
So you need an external JS script that has the main functions or a PHP page. Then you'd call the functions from within your module using JS.