Here is my index.php file:
<script type="text/javascript">
function addHit(str){
$.post("http://www.site.com/addclick.php", { id: str })
};
</script>
<a href="javascript:;" onClick="addHit('928'); return false;">update ID 928 with 1 click</a>
Here is my addclick.php
$id = $_POST['id'];
mysql_query("UPDATE `table` SET `x` = `x` + '1' WHERE `id` = '" . $id . "'");
If I have WHERE id = '1'
it updates row 928
perfectly, but when it is set as the post variable, it doesn't. The only thing I can think of is that the ajax call is not parsing the ID properly.
What is wrong with this?