Login using external database

I’m sorry for not being clear enough. I want the user to log in with the credential on my databases without I have to add them to my site members. At the very last, I want the site member to synchronize with my database, therefore I tried to make them registered through sign up lightbox (so their account will shows up on my site member), but their credential couldn’t be written on my database. Is it because I use external database, so it couldn’t be written on (even though, I already set up the database permission to allowed anyone write on my database) or there’s a problem with my code?