This is my code where I actually pass the value (variable countForPHP) using XHR:
Here's how I get the value sent from the XHR:
xmlHttp.open("GET", "count.php?r=" + Math.random + "&count=" + countForPHP, async);
Does anyone know how to solve this problem?
$counter = $_GET["count"];
$pdo = new PDO('mysql:host=host;dbname=database;', 'username', 'password');
$sql = "UPDATE tbl_click SET click = click + ($counter)";