I am New to development.I have created an simple html 5 game for facebook .I use post Request to update.php
to store score in database.
Below is my code
<?
include 'config.php';
mysql_connect(localhost,$user,$password);
$id = mysql_real_escape_string($_POST['id']);
$score = mysql_real_escape_string($_POST['score']);
@mysql_select_db($database) or die( "Unable to select database");
$query = "UPDATE heli SET score = '$score' WHERE app = '$id'";
echo $query;
$result=mysql_query($query);
mysql_close();
?>
Many Complain that my code is vulnerable to Sql injection.Any one Suggest good code that is Secure.Thanks..