Note that $array[0] is the first field in the data base and so on. Also this code is case sensitive but it does exact matching. If you want it to still do exact matching but be case insenitive than do this.

Thanks perlkid for the fast reply. I tried what you gave me here and works great for the testing the first code you put up, cause I need it to be case sensative. The only problem I am having is while it is testing it just keeps looping even after it has found a match.