Check for Duplicates in a Database Before Entering Data
        Posted  
        
            by gamerzfuse
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by gamerzfuse
        
        
        
        Published on 2010-03-23T02:34:44Z
        Indexed on 
            2010/03/23
            2:41 UTC
        
        
        Read the original article
        Hit count: 373
        
Before Entering data into a database, I just want to check that the database doesn't have the same username in the database already.
I have the username in SQL set as a key, so it can't be duplicated on that end, but I am looking at finding a more user-friendly error message then "KEY already exists".
Is there are simple way to check if the variable value already exists in a row?
Thanks!
© Stack Overflow or respective owner