TorqueScript has no MySQL interface (it's possible to code from what I've read of the MySQL protocol, but it'd be a stuff load of work) so you have to use a dynamic web page to access MySQL via TorqueScript. PHP is most commonly used.
You'd code the PHP script for accessing the database based on the get parameters or posted parameters. Once you've got a working web page, you need to communicate from TorqueScript using TCP objects or HTTP objects. There's plenty of resources on this in coding help already, or RTB, so take a look around.
The hardest part is security. If this is going to be a released add-on you need to make sure there's no way to extract private data. If what you want to do is actually post data to be added to the database in an add-on that will be released, then it's a horribly bad idea because there is basically no clean way to have the data not be false, so people would just spam your database with useless stuff and break things. If it's not going to be released, posting data is fine.