# Tips & Tricks & Optimization & professionalism

**URL:** <https://forum.kirupa.com/t/tips-tricks-optimization-professionalism/301921>\
**Category:** flash\
**Created:** [December 17, 2009, 7:40pm UTC](https://forum.kirupa.com/t/tips-tricks-optimization-professionalism/301921 "2009-12-17T19:40:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhaniko93](https://avatars.discourse-cdn.com/v4/letter/z/dbc845/32.png) [@zhaniko93](https://forum.kirupa.com/u/zhaniko93)\
**Post date:** [December 17, 2009, 7:40pm UTC](https://forum.kirupa.com/t/tips-tricks-optimization-professionalism/301921/1 "2009-12-17T19:40:03Z")

</div>

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:

```auto
<?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](http://www.actionscript.org/forums/attachment.php3?attachmentid=33179&d=1261081452)
