As Marc W's already pointed out php can only tell you what you've sent from the server, not what the client's received, so using strictly php is a non-starter.
But there is always the possibility of asking the user to confirm the download by pressing a button that calls a JS check by generating an MD5 hash and comparing that to the MD5 hash of the file on your server (the on-server MD5 being generated by you), and on a successful comparison use that JS script to update your db or use it to call a php-script to do the same.
You could always just ask them to check the download is what they expected and, if they hit "yes, it's fine" then update the database.
Edited: in response to OP's comment.
Thanks, but you can't depend on the users cooperativeness. Because they also have to pay for the download, it is better that I have all the controll.I think I will then update the database when the script is accessed. That seems to be the most reliable then.
How about using an Ajax control to initiate -and maintain- the download, and, on completion verifying its integrity and running an update to your db?
I'd suggest not automatically assuming your customers are going to rip you off, though, whatever you end up choosing. Asking them nicely 'did it work for you?' and, if not, leading to a bug-report might be useful for you and them.
But, regardless, while some of your users might say 'no' just for the extra copy you have to balance the cost of that against the cost of your increased workload to prevent its happening. If the cost of maintaining 'honesty' exceeds the potential/likely cost of their taking an extra copy, then there's little point.