$id = $_GET['id'];
$sql = "SELECT point FROM records WHERE id=".$id;
$result = mysql_query($sql);
$point = ((int)mysql_result($result,0,0)) + 1;
$sql "UPDATE records SET point = ".$point." WHERE id=".$id;
mysql_query($sql);
echo $point ;
ไฟล์ subtractPoint.php Code (PHP)
$id = $_GET['id'];
$sql = "SELECT point FROM records WHERE id=".$id;
$result = mysql_query($sql);
$point = ((int)mysql_result($result,0,0)) - 1;
$sql "UPDATE records SET point = ".$point." WHERE id=".$id;
mysql_query($sql);
echo $point ;