I've been trying to find an example of how to do this without much luck. I want to configure httaccess to allow IPs from a database, the idea being to allow users from a forum to access file downloads with all other traffic being blocked.

I'd appreciate an example of how to script this or ideas on another way to accomplish the same thing.