in reply to Integrating Script with .htaccess

mod_perl with Apache::AuthenDBI sounds about right. Or if no mod_perl mod_auth_mysql, etc.

UPDATE: Fixed typo s/DB/DBI/;

--
perl -p -e "s/(?:\w);([st])/'\$1/mg"