thanks, motin! ??
this is the code i put in games_score.php
<?
require('config.php');
$game = stripslashes($_POST['game']);
$name = stripslashes($_POST['name']);
$score = stripslashes($_POST['score']);
$databaseLink = mysql_connect($databaseHost, $databaseUser, $databasePassword);
mysql_select_db($databaseName, $databaseLink);
$game = addslashes($game);
$name = addslashes($name);
$score = addslashes($score);
$query = "INSERT INTO $databaseTableName (game, name, score, <code>date</code>) VALUES('$game', '$name', '$score', NOW())";
$result = mysql_query($query, $databaseLink);
?>success=true
this is the code i added in the last frame of the game, the one with the scores table :
getURL("/games/scores.php", "_blank");
gotoAndPlay(1);
and this is the code from the scores.php :
<?
//connect to mysql
//change user and password to your mySQL name and password
mysql_connect("mysql_host","db_user","db_pass");
//select which database you want to edit
mysql_select_db("db_name");
//select the table
$result = mysql_query("SELECT * FROM <code>highscores</code> WHERE game = 'snake3' && score !=0 order by score desc limit 0, 10");
echo "<table border='1'>
<tr>
<th>Name</th>
<th>Score</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['score'] . "</td>";
echo "</tr>";
}
echo "</table>";
?>