Refrence:
http://www.modwest.com/help/kb1-161.html
create a htaccess. file and add the following:-
Code:
AuthName "Your Protected Area"
AuthType Basic
# Directives specific to mod_auth_mysql
# mod_auth_mysql automatically connects to
# host: db.modwest.com
# Auth_MySQL_Info [server] [user] [pass]
Auth_MySQL_Username MYSQL_UNAME
Auth_MySQL_Password MYSQL_PASS
Auth_MySQL_DB MYSQL_DATABASE_NAME
Auth_MySQL_Password_Table MYSQL_TABLE_NAME
Auth_MySQL_Username_Field NAME_OF_USERNAME_FIELD
Auth_MySQL_Password_Field NAME_OF_PASSWORD_FIELD
Auth_MySQL_Encrypted_Passwords Off
# turn the above to "On" if you used crypt() on users'
# passwords before storing them
Auth_MySQL_Non_Persistent On
Auth_MYSQL On
# turn the above to "Off" if you want
# other authentication to take over in case the visitor
# fails mysql authentication
Auth_MySQL_Empty_Passwords Off
# turn the above to "On" if you want to allow authenticate
# just a correct username and no password
# End mod_auth_mysql specific directives
require valid-user
+++++++++++++++++++++
Where "MYSQL_UNAME" is your own MySQL
username, "MYSQL_PASS" is your own MySQL
password, "MYSQL_DATABASE_NAME" is your own MySQL
database name
"MYSQL_TABLE_NAME" is the name of the table in your database that contains the username and
password fields that will be used to do the authentication
"NAME_OF_USERNAME_FIELD" is the name of the field in the specified table that stores the username
"NAME_OF_PASSWORD_FIELD" is the name of the field in the specified table that stores the password.