From actionscript 2 you need to use LoadVars.
your_btn.onRelease = function() {
lv = new LoadVars();
lv.score = score;
lv.name = name;
lv.load("http://localhost/send.php", "POST");
lv.onLoad = function(src:String) {
if (src) {
// OK. src contains the output of the PHP file.
// i.e. what you "print" or "echo" from php.
trace(src);
} else {
// Problem. Most probably there's an error if src is undefined.
}
};
};
From PHP, you can get them from the $_POST array, and add them to mysql using mysqli.
$score = $_POST['score'];
$name = $_POST['name'];
// See a tutorial on how to add them to database.
// You need to connect to MySQL, then do an INSERT query to your table.
Mysqli Docs, or search for some tutorial on MySQL and php, there are plenty of them.