The only way to directly compare them is to either encrypt the user input using the same key and compare that, or decrypt the DB value and compare that.
But...I'm just guessing here that you are trying to handle passwords? If so, then you really, really don't want to encrypt anything! You should Hash the original, and store the hash instead - then for validation when they log in, you hash what they typed, and compare the two hashes. There is a tip showing how here:
Password Storage: How to do it.[
^]