Hi everyone. I am new in flash AS3 and I have made a little game. I want you to make corrections, optimize script, give advices how to make something easier. Also, in left down corner, there is score text and try this: take 100 score, than hit enemy, than take 200 score and hit enemy again. you will get error. I tried everything and can’t get rid of this error. upload_score.php is working fine:
<?php
$db = mysql_connect('localhost', 'root', 'vertrigo');
mysql_select_db('test', $db);
$n = 1;
$echo = '';
if(!isset($_POST['hash'])) {
$q = mysql_query("SELECT * FROM flash ORDER BY score DESC LIMIT 10");
while($r = mysql_fetch_array($q)) {
$echo.= 'name'.$n.'='.$r['name'].'&score'.$n.'='.$r['score'].'&';
$n++;
}
echo substr($echo, 0, strlen($echo)-1);
} else {
mysql_query("INSERT INTO flash (name, score) VALUES ('".mysql_escape_string($_POST['saxeli'])."', '".mysql_escape_string($_POST['qula'])."')");
}
?>
waiting for corrections and advices. thank you tooo much and sorry for my bad English and also upload_score.php gives me that: name1=JaKo&score1=560&name2=JaKo&score2=320&name3=JaKo&score3=240&name4=Player&score4=220&name5=Player&score5=200&name6=Player&score6=200&name7=Player&score7=200&name8=Player&score8=200&name9=Player&score9=200&name10=Player&score10=160
Files: Game Files