Hi, what function in flash are you using to post your scores to the php script?
I generally use:
And then the following score posting script;Code:loadVariablesNum("urlofscorepostingscript",0, "POST");
Code:<?php $db = mysql_connect("localhost", "username", "password") or die("Could not connect."); if(!$db) die("no db"); if(!mysql_select_db("db_name",$db)) die("No database selected."); if(isset($_POST['score'])) { $score=$_POST['score']; $name=$_POST['thename']; $countscore="SELECT COUNT(*) from asteriodscores"; $countscore2=mysql_query($countscore); $countscore3=mysql_result($countscore2,0); if($countscore3<10) { $insertscore="INSERT into asteriodscores (score,name) values('$score','$name')"; mysql_query($insertscore) or die("Could not insert score"); print "Score recorded."; } else { $getlowscore="SELECT * from asteriodscores order by score ASC limit 1"; $getlowscore2=mysql_query($getlowscore) or die("Could not get score"); $getlowscore3=mysql_fetch_array($getlowscore2); if($score>$getlowscore3[score]) { $replace="update asteriodscores set score='$score', name='$name' where ID='$getlowscore3[ID]'"; $replace2=mysql_query($replace) or die(mysql_error()); print "Score recorded."; } } } ?>




Reply With Quote