You may seen these scripts alot, but I like mine with mysql.

Here's a simple script free for use,
make sure you edit the autodownload.php to your settings.

It will block hotlinking and record the number of times the file was downloaded.

Instead of the $_GET variable, I used a request and a MYSQL table.
You put the id#, file name, and file location on the server (Example: /home/demo/public_html/fish/ into a mysql row.

The script will find the given id#, it will then give the script the location of the file, then finally have the user download it.

Every time someone downloads the file, it will add 1 to the small counter!