Chesso Posted March 30, 2006 Share Posted March 30, 2006 I've been building up a new version of my personal site (building and testing it locally) and I would like to implement a stat showing of how many times a particular file has been downloaded. I already have the database and fetching code done it's just the updating part i'm stuck on.On my files page up to 5/10 entrys are shown and they are directly linked, I don't have that annoying redirect to 50 other pages thing going on.... So I need to somehow update the download value to increase when they click on a download link.Any ideas?P.S. Sorry if this has been answered but because of my idiotic (and quite literally spastic brother) my speed has been capped to dial-up as well as he has the balls to still be playing WoW so searching all through the forum would take a long time. Quote Link to comment Share on other sites More sharing options...
Guest footballkid4 Posted March 30, 2006 Share Posted March 30, 2006 Try this:[code]<?php//connect to mySQLmysql_query( "UPDATE downloads SET downloads=downloads+1 WHERE id='" . $_GET['id'] . "'" );?>[/code]Then you can use that page to redirect to your download, or even download directly from that page Quote Link to comment Share on other sites More sharing options...
Chesso Posted March 31, 2006 Author Share Posted March 31, 2006 Iv'e come across another problem, I can't seem to Update/Replace a record in my table.Performing the query in phpMyAdmin works perfectly fine, however in my php script it does not.The code executes and nothing happens, no errors, no warning and other query like reading information work just fine......Any ideas? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.