AS2 - Problem with inserting score/name to mysql/database
Hello,
First of all.. sorry that I havn't put the AS in a box, not sure how to do it on this forum!
Okey so this is my problem:
I want to sumbit my score and name into my database.
This is the script I have tried in Flash.
stop();
//create loadVars Objects
playerx = new LoadVars();
playerRegistered = new LoadVars();
playerRegistered.onLoad = showResult;
//create button handler code to call function which sends & loads php
_root.submitt.onRelease = submitScore;
function submitScore():Void {
playerx.name = name_txt.text;
playerx.score = score_txt.text;
playerx.sendAndLoad("register.php",playerRegistered);
}
This is the PHP script:
<?php
$connect = mysql_connect('x.com.mysql','x','password');
mysql_select_db('x', $connect);
$sql = 'INSERT INTO high_scores_avoidthecars(name,score) VALUES ("'.$_POST['name'].'","'.$_POST['score'].'")';
?>
Nothing gets posted to the database, no error etc.. any ideas? ![]()