i am having problem updating the database.
Basically what i am trying to do is everytime a download link is clicked the download count in the database goes up.
Can someone point me in the right direction as i have been trying to get this right for hours :(
Here is the html.
<div class="button_border_dark"> <a id="linkcounter" href="http://www.derby-web-design-agency.co.uk/freeby-download/<?php echo $freebies_download ; ?>" target="_blank" title="Download">Click To Download File</a></div>
Here is the jquery
<script>
$('#linkcounter').bind('click',function(){
$.post("downloadcount.php",{ linkid: <?php echo $id ; ?>});
});
</script>
Here is the downloadcount.php which i am trying to post data too, so it updates the content.
<?php
require_once("applications/constants/connection.php");
require_once("applications/controllers/basic.php");
if(isset($_REQUEST["linkid"])){
$linkid = sanitise($_POST["linkid"]);
$updatedownload = mysql_query("UPDATE freebies SET download_count=`download_count` +1 WHERE id ='".$linkid."'") OR die(mysql_error());
}